Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Module for transparently forking a sub?

by kyle (Abbot)
on Feb 13, 2009 at 16:52 UTC ( [id://743641]=note: print w/replies, xml ) Need Help??


in reply to Re: Module for transparently forking a sub?
in thread Module for transparently forking a sub?

Basically, I don't know much about threads. My hazy impression of threads is that they offer little over forking and that it's hard to share a complex data structure with them. If that's not true, maybe using threads would make this all trivial, and I should just learn that.

  • Comment on Re^2: Module for transparently forking a sub?

Replies are listed 'Best First'.
Re^3: Module for transparently forking a sub?
by Corion (Patriarch) on Feb 13, 2009 at 16:54 UTC

    The sharing problems only arise if you actually try to use the same data structure concurrently from two or more threads. If you simply pass off parameters to a subroutine, or to a worker thread using Thread::Queue, you don't have much of a problem. And returning the information (say, again, via a queue) is easy too.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://743641]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-19 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found