Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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 pondering the Monastery: (6)
As of 2015-10-09 08:11 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (236 votes), past polls