It is currently Mon, 18 Nov 2019 21:53:58 GMT



 
Author Message
 Delivery of signals when thread not async safe
Hello,

When the threads package is not async safe, what is a common method for
dealing with the delivery of signals.?

Regards,
Nithyanand.



 Tue, 16 Sep 2003 00:38:37 GMT   
 Delivery of signals when thread not async safe

Don't use a signal handler.  Use sigwaitinfo() from a separate "signal delivery" thread.

You will need to do the following
        sighold() the signal

        sigaction() a dummy siginfo type signal handler for the signal. (on solaris
                       you need to do this to get sigwaitinfo to work.  Don't know
                       about the other platforms) This signal handler should never
                       get invoked.  If it is invoked, it is an error condition or
                       you forgot to issue sighold.

        from another thread do a sigwaitinfo polling loop.  this loop should do as little
        as possible so it can take signal delivery without too much delay.  If there's
        work to do, do it on other threads.   There is no async safe issue here.  The
        "signal delivery" thread is just another thread.

Joe Seigh



 Tue, 16 Sep 2003 18:09:24 GMT   
 
   [ 2 post ] 

Similar Threads

1. siglongjmp not async-signal-safe?

2. poll/select not async-signal safe

3. Why is localtime_r() not ASYNC-SIGNAL-safe ?

4. mmap, thread-safe, and signal-safe

5. Thread-safe and Signal-safe

6. Solaris 8 threads: If a routine is Async-Signal-Safe is it also thread Safe?

7. What is async-signal safe function


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software