This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: threads and signals


On Fri, May 09, 2003 at 04:27:04PM +0200, Thomas Pfaff wrote:
>As i already described in
>http://cygwin.com/ml/cygwin-patches/2003-q2/msg00076.html 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 ?

Yes, all of those are known issues.  I've made half-hearted attempts to
keep some hooks around for implementing the above but, right now, all of
cygwin makes the assumption that only the main thread will handle
signals.

As I'm sure you know -- this is a huge undertaking.  That's why it is
not implemented.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]