>>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:
DS> Right. I'm not talking about getting rid of signals--I want to make them
DS> work properly in perl 6, %SIG and all. What I'm thinking about is those
DS> things that signals are used for but aren't particularly optimal.
DS> Using alarm and $SIG{ALRM} to abort blocked or long-running things
DS> is one of the biggies (personally I think I'd prefer some sort of
DS> eval block with a timeout attached), since it doesn't work
DS> threaded, doesn't work well outside of Unix/VMS (read: WinXX), and
DS> won't let you have multiple one-shot or periodic timers. Using a
DS> signal, in this case, is something of a hack (though not ours)
DS> that can be done better.
that is still tricky. the timeout can occur while the interpreter is
inside a perl op. the main reason the eval/alarm/die trick works is that
the signal handler just calls die which unwinds the stack to before the
eval. if the handler did anything with memory, it could crash perl.
a more generic eval with timeout api is not a bad idea. but it will
almost surely use some form of delivery (internal or perl level
callback) that needs to be designed as a whole and not just a special
thing for eval.
so my point which i constantly harp on (sorry), is that the signal
delivery at the perl level (both language and internal) is a critical
design issue.
DS> I/O events are another area where we'll want to hide signals
DS> generally, since the PerlIO layer will want to be taking care of
DS> that itself.
even though the I/O subsystem will probably trap and use SIGIO
(especially for async file i/o on solaris et. al.), the final signal
delivery (i/o completion callback) still needs to be done synchronously
with the perl interpreter.
so please don't talk about these signals usages are important and need a
better api or this signal will only be used this way. the key is always
signal delivery. the rest is easier. :)
uri
--
Uri Guttman --------- [EMAIL PROTECTED] ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com