[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



Hi,

Larry Wall:
> Ilya Zakharevich writes:
> : We *need* an event loop in Perl core - or very close to it.  This may
> : be a part of this loop.
> 
> Indeed, that's what the perl-loop mailing list has been working on for
> lo these many months.  Any folks from perl-loop want to comment?
> 
Well, I'm not from perl-loop, but my idea of the signal handler would be
the following pseudocode.

The first time you create a new thread, Perl transparently installs
another thread which loops in
  wait_for(signal_semaphore)
  check_signal_list(threaded)

The C signal handlers just has to do an up() on the semaphore, in
addition to incrementing the counter for "their" signal; in all other
threads, the single-threaded case's periodic check_signal_list() is
a no-op.

The actual calling of the Perl signal handler involves the temporary
creation of a new thread; else we'd run into a situation where the
SIGUSR1 handler blocks, and the SIGUSR2 handler can't run because the
sig handler thread isn't inside its main loop at the moment. Not good.

You'll have exactly the same concurrency problems that exist today, of
course, but you now can use locks to protect the critical areas.

-- 
Matthias Urlichs  |  noris network GmbH   |   smurf@noris.de  |  ICQ: 20193661
The quote was selected randomly. Really.    |      http://www.noris.de/~smurf/
-- 
BRILLIANT'S OBSERVATION ON MODERN ART:
   Not all our artists are playing a joke on the public.
   Some are genuinely mad.


References to:
Ilya Zakharevich <ilya@math.ohio-state.edu>
Larry Wall <larry@wall.org>

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