[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



Ilya Zakharevich writes:
: Larry Wall writes:
: > 
: > Ilya Zakharevich writes:
: > : I wonder why not we add something like
: > : 
: > :   $SIG{CHLD} = [inc => \$counter, set => [\$foo, 13], pid => \$pid];
: > : 
: > : and avoid all the problems with a Perl function call altogether...
: > 
: > Bletch, in a vague sort of way.
: 
: But comparing to what we have now it would be a paradise.  ;-)

I was bletching the interface, not the implementation.  I agree that
the implementation of the current interface could use improvement.
This has all been discussed before.  We need to delay sub invocations
until we know we're in a safe state, such as the beginning of a
statement, or at the interator of any looping constructs, including
regular expressions.  Of course, within regular expressions we'd have
to take extra care to be re-entrant, but the swash routines already do
that now--see Perl_save_re_context().

An interesting question is where to install the checks in the regular
expression engine such that we do not suffer significant overhead,
while at the same time guaranteeing that the evaluation will progress
to a check point in reasonable time, say, less than a second or so.
Possibly the right time to check is at the longest failure of a * or +,
just before we start backing off.  Possibly we should just check on
every backoff, if accessing the global "signal_pending" variable is
cheap.

In this scheme, here's our C signal handler:

    Signal_t
    Perl_sighandler(int sig)
    {
	PL_signal_count[sig]++;
	PL_signal_pending++;
    }

Seems pretty safe to me.

Larry


Follow-Ups from:
Ilya Zakharevich <ilya@math.ohio-state.edu>
Tom Christiansen <tchrist@jhereg.perl.com>
Tom Christiansen <tchrist@jhereg.perl.com>
References to:
Ilya Zakharevich <ilya@math.ohio-state.edu>

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