RE: Killing a thread
[email protected] (Ajeet Kumar) Wed, 29 Sep 2010 15:03:48 +0530
| Newsgroups | perl.ithreads |
|---|---|
| Message-ID | <DF735188ED91BD458FA0E0C17929339F95421730@GUREXMB01.ASIAN.AD.ARICENT.COM> |
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:[email protected]] Sent: Wednesday, September 29, 2010 4:12 AM To: [email protected] 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 privi= leged 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 m= essage in error, please notify the originator immediately. If you are not t= he intended recipient, you are notified that you are strictly prohibited fr= om using, copying, altering, or disclosing the contents of this message. Ar= icent accepts no responsibility for loss or damage arising from the use of = the information transmitted by this email including damage from virus."