|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re^3: Parallel downloading under Win32?by Corion (Patriarch) |
| on Apr 29, 2009 at 20:10 UTC ( [id://760971]=note: print w/replies, xml ) | Need Help?? |
|
It's not actually hard. The system has threads that are fed off a Thread::Queue. Each thread takes a job from the queue, performs it, then takes the next one from the queue. The map just creates $T threads, and to tell each thread that it is finished, it sticks $T undef elements at the end of the queue. Then the main thread waits that all threads finish their work. That's all there is to it.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||