[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: [ID 19991229.003] perl 5.005_03 core dumps -- signal
On Wed, Jan 12, 2000 at 10:56:06AM -0500, dan@sidhe.org wrote:
> At 10:35 AM 1/12/00 -0500, Joshua N Pritikin wrote:
> >On Wed, Jan 12, 2000 at 10:18:24AM -0500, dan@sidhe.org wrote:
> > > In some ways its worse. Because threads are really separate processes,
> >
> >What's the difference? Memory sharing is the same, right?
>
> Yes, though there's more to a thread than memory sharing. (You can
> currently flock yourself into a deadlock too, FWIW, though hopefully
> they're fixing that, too)
Yah, they're definitely aware of that.
> > > only the thread that actually gets the signal delivered can see it.
> >
> >Yes. That's one of the reasons I felt that linux might be an
> >improvement over the POSIX mess.
>
> In some ways it is, for the synchronous signals--they're more installed
> error handlers than anything else. Async signals, on the other hand, are
> events rather than errors, and are delivered to the *process*, not to the
> thread. Who should get SIGHUP, or SIGCHLD, or SIGCONT, or SIGIO? These all
> deal with process-level events, and the thread that was responsible for
> them being generated (if you can even figure that out easily) isn't
> necessarily going to be the one that should handle them.
I don't know. At least the control is in the hands of the developer. On
the other hand, perhaps POSIX provides this as an option too. I am
hardly qualified to debate this stuff.
> >I never understood the alure of routing all the signals to a single
> >signal-handling thread. Can anyone comment on this?
>
> It makes handling the event signals easier. You just route 'em all to a
> single thread that deals with them, rather than having to cope with them in
> all your threads.
I'm still mystified. Obviously the library/kernel can do this
automatically but what is so hard about doing it at the application
level? Wouldn't it just be a matter of adding a bunch of handlers
to the children threads:
static Signal_t process_sighandler(int sig) { kill(ParentPID, sig); }
Am I missing something?
--
"Never ascribe to malice that which can be explained by stupidity."
via, but not speaking for Deutsche Bank
- Follow-Ups from:
-
Dan Sugalski <dan@sidhe.org>
- References to:
-
Joshua N Pritikin <joshua.pritikin@db.com>
Dan Sugalski <dan@sidhe.org>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]