Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^7: Threading in a loop

by Anonymous Monk
on Apr 22, 2013 at 15:09 UTC ( #1029903=note: print w/ replies, xml ) Need Help??

in reply to Re^6: Threading in a loop
in thread Threading in a loop

Trying to synchronize threads by creating large numbers of threads with small scope is probably not the way to go.

You code above has the added disadvantage of possibly printing some values twice while skipping a value later on.

Wise synchronization of threads will usually involve either queues or semaphores. Feel free to look into Thread::Queue or Thread::Semaphore for implementation details.

Comment on Re^7: Threading in a loop

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2016-04-30 16:15 GMT
Find Nodes?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW

    Results (441 votes). Check out past polls.