develooper Front page | perl.ithreads | Postings from December 2012

Re: pool example

Thread Previous
Jerry D. Hedden
December 13, 2012 17:35
Re: pool example
Message ID:
The timeout is 10.  A thread may sleep from 5 to 15 seconds.  So some will
end before getting killed.

Also, the timer thread does not know how long the sleep value in a thread

Again, this is an example of pooling.  Obviously, a thread that just sleeps
is useless.  The WORK section might do DB or web searches.  In that case,
you end result would be the main thread getting whatever results had been
obtained during the timeout period.

On Thu, Dec 13, 2012 at 12:15 PM, Alfonso Caponi

> Hi list,
> I've a question about pool example script (
> Theoretically, should the sub "timer" kill threads immediately when sleep
> value is greater than timeout value?
> At the moment seems that the threads wait for the sleep value than they got
> killed by sub "timer".
> Thank you

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About