Python Forum

Full Version: ignoring a signal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
is there a way for python to ignore a specific signal (in posix) without setting up a handler? all the google results describe how to handle a signal. i'm expecting a very rapid burst of several signals.
What about using the handler signal.SIG_IGN?
the problem with that, as i see it, is that it appears to be a handler, not a symbol. my worry with a handler is how signals get masked. i need to be 100% certain that a flood of signals cannot be a detriment-of-service.

i see that the document you point to refers to it as a special value. i wonder if signal.signal() really calls the old unstable signal() syscall or the new sigaction() syscall. i wonder if i still have any of my very old C code around where i used signal() to see how i handled that. i could not find signal.sigaction() anywhere.

it turns out that GLIBC may influence the behavior of a call to signal(), depending on the definition of _BSD_SOURCE at the C code level (of CPython).
What is the the problem with having a handler? Is it not fast enough?
How many signals do your program receive per microsecond?

If you're flooding your program with signals, then something went wrong.
Better approach is to stop the signal-flooding.
multiple processes may reflect a signal to this one process, concurrently. i have had this issue happen in C, before. i had to get the signal to be ignore to make it work. i have had experience with high signal rates. another solution is signal masks. but i need to call sigaction() for that.