I have an application which is communicating with workers via signals (particullary SIGUSR1/SIGUSR2/SIGSTOP).
Can I trust that whatever happens every signal will be delivered and processed by handler?
What happens if signals are sent quicklier than is't possible for application to handle them (eg. due to high host load at the moment)?
Best Answer
Aside from the "too many signals" problem, signals can be explicitly ignored. From
man 2 signal
:Signals can also be blocked. From
man 7 signal
;Both blocked and ignored sets of signals are inherited by child processes, so it may happen that the parent process of your application ignored or blocked one of these signals.
What happens when multiple signals are delivered before the process has finished handling previous ones? That depends on the OS. The
signal(2)
manpage linked above discusses it:libc
, but I'd expect the BSD behaviour.