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.


In reply to •Re: the unsafe signals controversy by merlyn
in thread the unsafe signals controversy by jfroebe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.