Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Thread Design help

by Corion (Patriarch)
on Sep 11, 2010 at 08:26 UTC ( [id://859727]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Thread Design help
in thread Thread Design help

As an aside, you should maybe consider actually replying to the person posting code instead of replying to yourself. If you reply to another person, that person will get notified of your post.

The first part of the code is simply a loop that puts one undef for each thread into the queue. As all the thread code is written to stop when it encounters an undef, this serves to tell the threads that they are done. See See Thread::Queue for the ->enqueue command.

The second part simply launches the subroutine getData in a separate thread. See threads.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found