develooper Front page | perl.perl6.porters | Postings from April 2000

Re: Torvalds on POSIX threads

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
April 10, 2000 14:33
Subject:
Re: Torvalds on POSIX threads
Message ID:
4.3.0.20000410172832.01d4c650@24.8.96.48
At 02:25 PM 4/10/00 -0700, Chip Salzenberg wrote:
>According to Joshua Pritikin:
> >   o the POSIX standard is technically stupid. It's much better to use a
> >     cleaner fundamental threading model and build on top of that.
> >   o things like the above are just so much better and more easily done in
> >     user space anyway.
>
>I agree.  POSIX threads' signal-handling model is really awkward, if I
>understand it correctly.  I've never spent a lot of time on it, but
>wearing my implementor hat, just the very idea of having a separate
>signal mask for each thread gives me the screaming heebie jeebies.

Signals are pretty broken under threads, that's for sure. Their limitations 
really come to the forefront with threads. The lack of guarantees built 
into the standard doesn't help much either.

The only sane way to handle signals with threads is to mask them off for 
all your threads except one that's set up to handle them. (The various OS 
vendors don't even agree on which signals are synchronous and which are 
async under threads just to add to the fun)

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About