Is a signal sent with kill to a parent thread guaranteed to be processed before the next statement?
Posted
by Jonathan M Davis
on Stack Overflow
See other posts from Stack Overflow
or by Jonathan M Davis
Published on 2010-04-24T02:07:16Z
Indexed on
2010/04/24
2:13 UTC
Read the original article
Hit count: 348
Okay, so if I'm running in a child thread on linux (using pthreads if that matters), and I run the following command
kill(getpid(), someSignal);
it will send the given signal to the parent of the current thread.
My question: Is it guaranteed that the parent will then immediately get the CPU and process the signal (killing the app if it's a SIGKILL or doing whatever else if it's some other signal) before the statement following kill()
is run? Or is it possible - even probable - that whatever command follows kill()
will run before the signal is processed by the parent thread?
© Stack Overflow or respective owner