threads and signals

Thomas Pfaff
Fri May 9 14:27:00 GMT 2003

As i already described in the current
signal implementation does not work very well with multithreaded apps.

AFAICS there are several issues that should be addressed:

1. The global signal_arrived handle must be changed on a per thread
basis so that only the signaled thread will wake up when interrupted.

2. The signal must be handled in the context of the signaled thread and
not in the context of the mainthread.

3. I assume that it is unsupported that with pthreads the mainthread is
just a thread that can be terminated without terminating the whole
programn, therefore the signal delivery must work even if the mainthread
has terminated.

4. If a signal is sent via kill to the whole process it must be set to
pending only if that signal is blocked by all threads, otherwise it
should be delivered to one of the threads that has enabled it.
The first thread unblocks a pending signal will get it.

5. Pending signals must be supported on a per thread base for signals 
that are sent via raise or pthread_kill.

6. Add support for sigwait.


Before i start sending patches i would like to know if there is any
interest besides me for a change ?


More information about the Cygwin-developers mailing list