sigwait

Alex Waugh alex at alexwaugh.com
Thu Feb 3 13:47:55 PST 2005


In message <3325.213.122.5.185.1107265631.squirrel at 213.122.5.185>
          "Nick Burrett" <nick at sqrt.co.uk> wrote:

> Alex Waugh said:
> > Nick Burrett wrote:
> >
> >> Alex,
> >>
> >> Could you have a look at implementing the 'sigwait' function in UnixLib
> >> ?
> >> I am uncertain if/how you are handling signal delivery to threads.  This
> >> would be most useful to improve Ada Tasks support.
> >
> > Currently the signal handling doesn't have any concept of delivering a
> > signal to a particular thread. I'll investigate how difficult that would
> > be.
> 
> OK, that's what I suspected.  I think it will entail a fair bit of work.

I've had a quick look at it now, and I agree that it would be a fair
bit of work to implement it properly. However, I think it would be
possible to implement a partial solution without too much effort, by
making use of condition variables. A call to sigwait would cause a wait
on a condition variable, then a call to pthread_kill would signal the
condition variable before raising the signal. Normal signals wouldn't
cause sigwait to return. Would something like that be good enough for
Ada?

Alex

-- 
Alex Waugh                                           alex at alexwaugh.com

PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/



More information about the gcc mailing list