Trying to make your Perl scripts non-blocking preprocessing their source... well, I don't think it is a good idea, at least if you want your scripts to support the language fully and not just a subset. This should be done at the C level, inside the interpreter.

Coro does half of it, running several perl threads inside the same system thread, the missing part is to rewrite the internal perl opcodes that can block to be non-blocking... though, I don't think this will be easy either.

In any case, there are languages that natively support this thread model, for instance Python or Stackless Python or Oz that you should also check.

update: very similar to Coro but at the C level is the GNU pth package. At first look, porting perl to run over this library doesn't look as complex as the alternatives. The idea would be to have several pth-threads at the C level and one independent perl interpreter running inside every one.


In reply to Re: Perl as embedded script language by salva
in thread Perl as embedded script language by Sewi

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.