develooper Front page | perl.ithreads | Postings from November 2011

timing out threads

Thread Previous | Thread Next
From:
dannwong
Date:
November 1, 2011 23:27
Subject:
timing out threads
Message ID:
D59C59453D0EDC43832490B6DADFAECF04C3F312@XMB-RCD-214.cisco.com
Hi Thread GURU,
	I would like to perform the following, start X (say 10) number
of threads to perform some operation (ex. Copy command), I would like to
exit or return out of the thread(s) that takes too long ( ex. 30 minutes
). I'm thinking I should spawn an independent thread (a watch thread)
and have that thread watch to see if any of the 10 threads are taking
longer than 30 minutes to complete. Any example how I can accomplish
this? Any other suggesting would be great to. 

BTW, I'm using perl 5.8.8., thread version 1.07.

Thanks.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About