Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1029903]
help
Chatterbox?
[Discipulus]: me too, i need a Dumas time, see you
[shmem]: que descanses bien, aprendiz
shmem wuff & wech
[shmem]: erm. wrong link. wrong link!
[shmem]: que descanses bien, aprendiz
[Discipulus]: bravo!

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2017-04-29 23:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (534 votes). Check out past polls.