in reply to the unsafe signals controversy
It seems to me that 'deferred signals' is a temporary workaround until the 'unsafe signals' can be made safe. Does anyone else feel this way?It doesn't matter how anyone feels on the matter. You either take a signal dispatch within an opcode (unsafe), or you don't (safe).
If you take one within an opcode, there's a chance that the opcode is executing something nasty, like redeploying a hash that's grown too big for its britches. If your signal code also accesses the same hash, boom, you're gone!
If you wait until the opcode is done, the world is a safer place, because you won't be in the "middle" of a Perl instruction. The problem is, some opcodes can take a really long time, as you've apparently discovered.
I don't really see a third option. It's not like some magical component is going to fall out of the sky that'll make it possible to do intra-opcode interrupts that automatically avoid touching everything that is mid-action. That'd be like interrupting a processor instruction in the middle of an add or something.
I remember reading a book on CPU architecture when I was really young, and came across the astounding assertion that at some level, all interrupts are really polls, so that they happen at the proper logical time. You're just seeing that the granularity of Perl "polling" is a single Perl opcode, as expected by design.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: the unsafe signals controversy (grainy)
by tye (Sage) on Mar 23, 2004 at 17:10 UTC | |
by TimToady (Parson) on Mar 23, 2004 at 21:16 UTC | |
by Old_Gray_Bear (Bishop) on Mar 23, 2004 at 18:46 UTC | |
|
Re: •Re: the unsafe signals controversy
by jfroebe (Parson) on Mar 23, 2004 at 18:53 UTC | |
by mpeppler (Vicar) on Mar 24, 2004 at 04:27 UTC | |
|
Re: •Re: the unsafe signals controversy
by eserte (Deacon) on Mar 23, 2004 at 17:45 UTC | |
by Anonymous Monk on Mar 23, 2004 at 22:22 UTC | |
by Anonymous Monk on Mar 23, 2004 at 22:39 UTC |