(The following is mostly supposition, based on my current experience implementing Thread::Sociable)
  1. threads::shared is based on tie()s, which don't completely support handles yet (tho 5.10 looks promising)
  2. How to deal with multiple threads writing to or esp. closing a handle (more complicated than just refcounting)
  3. The fact that the handle needs to be instantiated in the shared interpretter: how does it get there ? perhaps a new open(), e.g., shared_open() ? Or predeclare a lexical handle variable as shared ?
  4. Maintaining the illusion of fork() on Windows
I've vague notions about trying to hack something via PerlIO layers and routing thru shared (or rather, sociable) scalars to an I/O object, but need to better understand how the clone operation works. (and based on some recent p5p posts, it appears PerlIO isn't entirely thread-safe).

However, the tie() approach w/ special open() to install things into the shared interpretter is looking more attractive to me (despite the beached whale issue aka the global shared interpretter lock), though its likely to require big gobs of XS/C.


Perl Contrarian & SQL fanboy

In reply to Re: Sharing globs by renodino
in thread Sharing globs by BrowserUk

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.