Hi Ajeet,
        Do you have an example you can provide? I prefer not to loop
around (like sleep for 60 seconds and check again) checking for the
total time and then kill the thread if it takes too long.

Sincerely yours,
Danny H. Wong


-----Original Message-----
From: Ajeet Kumar [mailto:ajeet.ku...@aricent.com] 
Sent: Wednesday, September 29, 2010 2:34 AM
To: Danny Wong (dannwong); perl-ithreads@perl.org
Subject: RE: Killing a thread

Hello Wong,

Following is my approach in this case...

--Execute the "ps -A" command
-- Observe the third column , which is total time taken by process
-- check the process ID from the first column
-- send a kill -9 signal to required process ID

If any confusion is left, then do mail back...

-----Original Message-----
From: Danny Wong (dannwong) [mailto:dannw...@cisco.com]
Sent: Wednesday, September 29, 2010 4:12 AM
To: perl-ithreads@perl.org
Subject: Killing a thread

Hi Perl Thread GURUS,
        Here is my situation. I started, say 10 threads, executing some
command, 1 or 2 of them is hanging for over 2 hours. I want to put in
some logic that if the thread run time passes an hour threshold kill
that thread or return and fail the thread. Any ideas on how I can
accomplish this task? Thanks.

Sincerely yours,
Danny H. Wong



"DISCLAIMER: This message is proprietary to Aricent and is intended
solely for the use of the individual to whom it is addressed. It may
contain privileged or confidential information and should not be
circulated or used for any purpose other than for what it is intended.
If you have received this message in error, please notify the originator
immediately. If you are not the intended recipient, you are notified
that you are strictly prohibited from using, copying, altering, or
disclosing the contents of this message. Aricent accepts no
responsibility for loss or damage arising from the use of the
information transmitted by this email including damage from virus."

Reply via email to