Hi,
The program is still exits sometimes without waiting for the threads to finish . I 
can't understand it. It seem like the "join" just doesn't waits to the process to 
finish , it just cleans after the thread and decrements the threads->list.
Igor

-----Original Message-----
From: zentara [mailto:[EMAIL PROTECTED]
Sent: Monday, October 13, 2003 8:19 PM
To: [EMAIL PROTECTED]
Subject: Re: FW: threads in perl


On Mon, 13 Oct 2003 18:29:09 +0200, [EMAIL PROTECTED] (Igor
Ryaboy) wrote:

>Very Nice , 
>There is only one unsolved issue here: Your program may exit with other threads are 
>still running , beside this I liked it very much. The actual solution you supplied is 
>the
> use of threads->self function.
############################################
Yeah I fixed this. 
>#cleanup leftover running threads
>print "data exhausted, waiting for threads to finish\n";
>threads->list()->join;

Replace the above with:

#cleanup leftover running threads 
print "data exhausted, waiting for threads to finish\n";
while (1){
@running_threads = threads->list;
if (scalar(@running_threads) < 1){print "\nFinished\n";exit}else{next}
}

#################################################


>Thanks you very much!!!
Your welcome, it was a learning experience for me too. :-)
>Igor
>BTW where can I get some documentation about threads::Pool?

Download the module from cpan. But I just checked out the latest
version of Threads::Pool and it only works with perl5.8.0-RC3 or
later. I installed 5.81 to test it, but 5.81 broke some other modules
I'm playing with. So.....it's up to you.



Our body's 20 milligrams of beta radioactive Potassium 40
emit about 340 million neutrinos per day, which go at
lightspeed to the ends of the universe!..even thru the earth. 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to