in reply to Threaded Sockets, access from outside thread?

threads won't allow you to share blessed objects directly, and IO::Socket handles are blessed globs. The only workaround that I've discovered so far is to share the fileno of sockets that you wish to use from multiple threads (which Perl sees as simple scalars), and then use this to dup the socket into other threads that need to access the socket.

See Re: FileHandles and threads & Re: multithreaded tcp listener with IO::Socket and associated subthreads for some background and detail.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Threaded Sockets, access from outside thread?
by ecuguru (Monk) on Jun 19, 2006 at 01:38 UTC
    I'm willing to pay to get the code above to be able to share sockets, or to have a program that can host socket connections while shooting data back/forth to a single socket server. Any recommendations on where I can post for a mercenary perl coder to fix the code? And in general, for random bits of code that I'd be willing to outsource, where can I go to find pay for talent?
    thanks! You can reach me at dingofan at g mail dot com