Hi,
I need some help about a done-method wordaround with ithreads.
Currently i am implementing a script which starts some ithreads parallel until a
maximum count is reached.
Then, when one of these threads are done, start the next thread.
But what is the best way to do this ?
perldoc.org:
The done method returns true if the thread you're checking has finished, and
false otherwise. (Not available with ithreads.)
With normal threads i would do it like this:
foreach $thread (Thread->list) {
while(1){#wait for a thread to be finished
foreach $thread (Thread->list) {
$bool = $thread->done; #thread is done?
last if ($bool);# if $bool true exit foreach
}
last if ($bool);# if $bool true exit while
}
$thread->join();# join this Workerthread
}
Are there some resources or workarounds i can work with ?
Many many thanks in advance :)
- Clemens
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.