signals/threads



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 ?
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.
d) In general is it advisable to use mutexes/sempahores inside signal
handlers ?

Thanks

.



Relevant Pages

  • Re: nptl and signals
    ... > sigwait for blocked signals when those signals will be dilevered to the ... > making the flag 1 in that signal handler function that's why I need ... execution of any thread for which it ...
    (comp.programming.threads)
  • Re: memmove crash
    ... arrays pointed to by the two pointers, and compare the number of characters to be moved with those sizes. ... all kinds of stuff that has to be done when that signal handler is called, so I'd have to go through it all and make sure none of it calls any libc functions that are going to do a malloc, and it's not like it's easy to tell which ones do and which ones don't. ... Even if that option did guarantee that the C99 standard were strictly followed, that does not mean that every compiler out there supports C99 yet. ... discovered sigaction the other day, which is much nicer than signal in that it lets you do the automatic re-registration of handlers, whereas signal does not, and it lets you mask other signals while in the handler. ...
    (alt.lang.asm)
  • Re: Understanding Signals
    ... > current execution is stopped (possibly within an unsafe region such as ... > any insight as to the details of how signals actually work. ... > protecting initialize() is naive because between the test for!initialize ... Why don't you initialize it before setting the signal handler? ...
    (comp.unix.programmer)
  • Re: memmove crash
    ... library functions, do not get invalid arguments, thus invoking undefined behavior. ... all kinds of stuff that has to be done when that signal handler is called, so I'd have to go through it all and make sure none of it calls any libc functions that are going to do a malloc, and it's not like it's easy to tell which ones do and which ones don't. ... Now if something that compiles with "-ansi" just fine on my Linux system doesn't compile on yours, then I think I definately want to go back to assembly language. ... those automatically re-registering signals are nice. ...
    (alt.lang.asm)
  • Gl1bC L1nuxThreadz ADV1SORY, was Re: [Full-Disclosure] bombings in bali
    ... int sigaction(int sig, const struct sigaction * act, ... struct sigaction newact; ... /* Record that we're in a signal handler and call the user's ... just mask off all signals for signal handling, ...
    (Full-Disclosure)