Re: [threads] Forced termination

2005-08-29 Thread $Bill Luebkert
Tom Pollard wrote: > The use of an alarm to timeout an eval{} block definitely works. I don't > know why it works, but it does. I do get the impression that alarms are > handled in some special way by perl, because this idiom works on all > platforms we've tried it on (Linux, AIX, IRIX, MacOSX,

Re: [threads] Forced termination

2005-08-26 Thread Tom Pollard
On Thu, 25 Aug 2005, $Bill Luebkert wrote: > >>win32 doesn't have signals and any that are implemented don't actually > >>interrupt the receiving process. I believe they just use simple message > >>passing to fake it - so your mileage may vary. > > > > My point was precisely that "they" have arra

RE: [threads] Forced termination

2005-08-25 Thread John Serink
You sure this works under windows? > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Tom Pollard > Sent: Friday, August 26, 2005 2:17 AM > To: ajpeck > Cc: Perl Win32 mail list > Subject: Re: [threads] Forced terminatio

Re: [threads] Forced termination

2005-08-25 Thread $Bill Luebkert
Tom Pollard wrote: > On Thu, 25 Aug 2005, $Bill Luebkert wrote: > >>win32 doesn't have signals and any that are implemented don't actually >>interrupt the receiving process. I believe they just use simple message >>passing to fake it - so your mileage may vary. > > > My point was precisely tha

Re: [threads] Forced termination

2005-08-25 Thread Tom Pollard
On Thu, 25 Aug 2005, $Bill Luebkert wrote: > win32 doesn't have signals and any that are implemented don't actually > interrupt the receiving process. I believe they just use simple message > passing to fake it - so your mileage may vary. My point was precisely that "they" have arranged that this

Re: [threads] Forced termination

2005-08-25 Thread $Bill Luebkert
Tom Pollard wrote: > On Thu, 25 Aug 2005, ajpeck wrote: > >>Is there a way to forcibly terminate a thread after a specified time >>regardless if the thread is finished executing. > > > The standard eval{}-timeout technique apparently works well for threads. > That is, wrap the code that might

Re: [threads] Forced termination

2005-08-25 Thread $Bill Luebkert
Foo Ji-Haw wrote: > I guess Perl's threading is not quite complete as of 5.8.x. But with forking > it is possible to kill a child process? You can certainly do it using Win32::Process, but you may have more trouble passing info to/from - I've never used the simulated fork on Win32. -- ,-/-

Re: [threads] Forced termination

2005-08-25 Thread Tom Pollard
On Thu, 25 Aug 2005, ajpeck wrote: > Is there a way to forcibly terminate a thread after a specified time > regardless if the thread is finished executing. The standard eval{}-timeout technique apparently works well for threads. That is, wrap the code that might hang for 5 min in an eval{} block

Re: [threads] Forced termination

2005-08-25 Thread Foo Ji-Haw
" Sent: Thursday, August 25, 2005 6:23 PM Subject: Re: [threads] Forced termination ajpeck wrote: Is there a way to forcibly terminate a thread after a specified time regardless if the thread is finished executing. I have threads which call certain network functions that have very long hard c

Re: [threads] Forced termination

2005-08-25 Thread $Bill Luebkert
ajpeck wrote: > I am now trying a process and threads hybrid to get around the problem. > > We can hope that for Perl 6 a function can be added to threads for > immediate termination of child threads and freeing resources immediately > from the parent thread. You may not be able to free all of

Re: [threads] Forced termination

2005-08-25 Thread ajpeck
I am now trying a process and threads hybrid to get around the problem. We can hope that for Perl 6 a function can be added to threads for immediate termination of child threads and freeing resources immediately from the parent thread. Alun $Bill Luebkert wrote: ajpeck wrote: Is there

Re: [threads] Forced termination

2005-08-25 Thread $Bill Luebkert
ajpeck wrote: > Is there a way to forcibly terminate a thread after a specified time > regardless if the thread is finished executing. I have threads which > call certain network functions that have very long hard coded timeouts, > such as 5 mins. A no response of 5 secs is sufficient for me to

RE: [threads] Forced termination

2005-08-25 Thread John Serink
To: Perl Win32 mail list > Subject: Re: [threads] Forced termination > > > The problem is that I need to reclaim the memory resource of > the thread > that is not needed no more, so I can start off a new thread. > Thus detach > is not suitable in this case. > > Alun

Re: [threads] Forced termination

2005-08-25 Thread ajpeck
The problem is that I need to reclaim the memory resource of the thread that is not needed no more, so I can start off a new thread. Thus detach is not suitable in this case. Alun John Serink wrote: Just detach them and forget about them. other than that, I don't think there's a way to termi

RE: [threads] Forced termination

2005-08-25 Thread John Serink
Just detach them and forget about them. other than that, I don't think there's a way to terminate them. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of ajpeck > Sent: Thursday, August 25, 2005 3:02 PM > To: Perl Win32 mail list > Subject: [thread