[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



On 11 Jan 2000, Simon Cozens wrote:

> I hate to suggest this, but wouldn't
> 	$SIG{FOO} = sub { ++$count; return }
> be easier for all concerned?
> 
> The even-numbered elements to your anon array there (not even a hash.
> furrfu.) appear to be forming a `sub-language' - inc, set, and so on.
> This seems wasteful:
> 	If you disallow running arbitary code, you're restricting people.
> 	If you allow, say, a `[code => sub { ... }]', everyone will use that
> instead of the other `instructions', out of laziness.

True, but currently a sub {} cannot be executed by a signal handler in a
safe manner.  If a signal arrives at a critical moment, such as inside
malloc or some other non-reentrent system call, then even calling a simple
sub {} is not garaunteed to be safe.  Ilya's "sub-language" is one
proposal to solve this problem - presumably some XSUB would be cooked up
to parse the defined sublanguage and take action when recieving
signals.

-sam



References to:
simon@brecon.co.uk (Simon Cozens)

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