Search This Blog

Friday, April 23, 2010

Is a signal sent with kill to a parent thread guaranteed to be processed before the next statement?

Programmer Question

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?



Find the answer here

No comments:

Post a Comment

Related Posts with Thumbnails