Re: signals/threads
- From: "Nils O. Selåsdal" <NOS@xxxxxxx>
- Date: Fri, 23 Dec 2005 13:07:55 +0100
Ask wrote:
Any of the threads that has not the signal blocked.Hi
I have some basic questions on signals in Linux
a) In which context the signal handler is executed - (the thread that registered for the handler, or something else)
b) What happens if the same signal comes again while the signal handler execution is still not complete ? Will the new signal be lost ?
Read a bit at http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html
c)Can a deadlock possible in this case - Say thread acquires a semaphore and is in the middle of the CS. Then signal handler comes in execution and tries to grab the same semaphore.
Yes, there is a very limited amount of functions you can call directly or implicittly in a signal handler, grabbing a semaphore/mutex is not one of those.
d) In general is it advisable to use mutexes/sempahores inside signal handlers ?
Never do it.
.
- References:
- signals/threads
- From: Ask
- signals/threads
- Prev by Date: signals/threads
- Next by Date: Re: Comparing time in Linux
- Previous by thread: signals/threads
- Next by thread: Re: signals/threads
- Index(es):
Relevant Pages
|