(The following is mostly supposition, based on my current experience
implementing Thread::Sociable)
- threads::shared is based on tie()s, which don't completely support
handles yet (tho 5.10 looks promising)
- How to deal with multiple threads writing to or esp. closing a handle
(more complicated than just refcounting)
- 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 ?
- 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