Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^4: Thread Design help

by Corion (Pope)
on Sep 11, 2010 at 08:26 UTC ( #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.

Comment on Re^4: Thread Design help
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2015-11-29 20:03 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (753 votes), past polls