[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 -- singal



At 04:33 PM 1/11/00 -0500, Ilya Zakharevich wrote:
>On Tue, Jan 11, 2000 at 04:32:46PM -0500, Dan Sugalski wrote:
> > At 04:19 PM 1/11/00 -0500, Ilya Zakharevich wrote:
> > >This is indeed a questionable behaviour.  What are other things people
> > >want to do in a sighandler?
> > >
> > >   a) set a variable;
> > >   b) increment a variable;
> > >   c) exit();
> > >   d) wait() and assign the result;
> > >   e) wait() and append the result to an array/hash;
> > >   f) die with a message;
> >
> > g) Queue up another I/O request
> > h) Update a Tk display
> > i) Send a syslog message
> > j) Close one file on a filehandle and open another
>
>If die() were safe, all these would easy to implement...

Really? All die needs to do is propagate either a string or an object out 
to the non-signal code. There's a touch more involved in the things I listed.

There's no reason you shouldn't be able to do just about anything you want 
in a perl signal handler. I might draw the line at things that jump into 
the lexer, but that still seems restrictive.

> > > > : Let me repeat one of the reference points: close to impossible under
> > > OS/2.
> > > >
> > > > Let me point out that we don't have to deliver C level signals to
> > > > another thread.  We only have to deliver Perl level signals.
> > >
> > >Not a tiny bit easier: you still need to unblock the thread.
> >
> > So? Unless the thread is waiting on a blocking system call it's not a big
> > deal.
>
>Why do you thing it is not going to be waiting on a blocking system
>call most of the time?  For many threading paradigms this is exactly
>what happens.

So we have sync system calls instead spawn off a thread to do the call 
while the spawning thread cond_waits on something. To wake the thread you 
kill the thread doing the syscall and pop a cond_signal to the waiting 
thread. There are other ways, too, of course.

> > The thread's cond_waiting and you signal it.
>
>What made you thingk cond_wait() is not a blocking system call?

What makes you think the cond_wait that I'm thinking of is the one you're 
thinking of? And what makes you think I'm not considering tracking the 
condition and signalling it?


					Dan

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


Follow-Ups from:
Ilya Zakharevich <ilya@math.ohio-state.edu>
References to:
Dan Sugalski <dan@sidhe.org>
Larry Wall <larry@wall.org>
Ilya Zakharevich <ilya@math.ohio-state.edu>
Ilya Zakharevich <ilya@math.ohio-state.edu>
Ilya Zakharevich <ilya@math.ohio-state.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]