Re: [Tutor] How to deal with a thread that doesn't terminate

2008-02-20 Thread Tiger12506
Similar to the TerminateProcess function in win32api, there is the TerminateThread function which you can use if you know the handle of the thread, but it seems that you can only get the thread handle if you are calling from that thread, or if you were the one who created it (and saved the retu

Re: [Tutor] How to deal with a thread that doesn't terminate

2008-02-20 Thread Tony Cappellini
Thanks Michael. On Feb 19, 2008 11:23 PM, Michael Langford <[EMAIL PROTECTED]> wrote: > Instead of using a thread, you could see if you could use a second > process. For instance, the following would work on windows (and is > killable). > > import subprocess > import win32api > > class SpawnCont

Re: [Tutor] How to deal with a thread that doesn't terminate

2008-02-19 Thread Michael Langford
Instead of using a thread, you could see if you could use a second process. For instance, the following would work on windows (and is killable). import subprocess import win32api class SpawnController(object): def __init__(self,cmd): self.cmdline = cmd def start(self): se

Re: [Tutor] How to deal with a thread that doesn't terminate

2008-02-19 Thread John Fouhy
On 20/02/2008, bob gailer <[EMAIL PROTECTED]> wrote: > Tony Cappellini wrote: > > On Feb 19, 2008 2:02 PM, bob gailer <[EMAIL PROTECTED]> wrote: > > > >> Tony Cappellini wrote: > >> > >>> When I executing a program external to the main program in a thread, > >>> and that thread hangs, can the threa

Re: [Tutor] How to deal with a thread that doesn't terminate

2008-02-19 Thread bob gailer
Tony Cappellini wrote: > On Feb 19, 2008 2:02 PM, bob gailer <[EMAIL PROTECTED]> wrote: > >> Tony Cappellini wrote: >> >>> When I executing a program external to the main program in a thread, >>> and that thread hangs, can the thread be terminated? >>> >>> >> Please define "hangs". >

Re: [Tutor] How to deal with a thread that doesn't terminate

2008-02-19 Thread bob gailer
Tony Cappellini wrote: > When I executing a program external to the main program in a thread, > and that thread hangs, can the thread be terminated? > Please define "hangs". AFAIK that could mean waiting on an external event / signal / communication that never happens, or running in an "infini

Re: [Tutor] How to deal with a thread that doesn't terminate

2008-02-19 Thread Tony Cappellini
On Feb 19, 2008 2:02 PM, bob gailer <[EMAIL PROTECTED]> wrote: > Tony Cappellini wrote: > > When I executing a program external to the main program in a thread, > > and that thread hangs, can the thread be terminated? > > > Please define "hangs". > AFAIK that could mean waiting on an external even

[Tutor] How to deal with a thread that doesn't terminate

2008-02-19 Thread Tony Cappellini
When I executing a program external to the main program in a thread, and that thread hangs, can the thread be terminated? How does one handle this situation? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor