Re: Killing subservient threads

2009-03-12 Thread Aahz
In article , Christian Heimes wrote: >Gabriel Genellina wrote: >> >> 1) make the child window set a flag in the thread (let's say, >> t.terminate = True). And make the polling thread check the flag >> periodically (you possibly already have a loop there - just break the >> loop when you detect th

Re: Killing subservient threads

2009-02-20 Thread Gabriel Genellina
En Fri, 20 Feb 2009 16:15:10 -0200, jimzat escribió: I am using the thread module and calling thread.start_new_thread (...). If I use t=thread.start_new_thread(...) and later set t.terminate, I get "AttributeError: 'int' object has no attribute 'terminate'" Use the threading module instead,

Re: Killing subservient threads

2009-02-20 Thread jimzat
On Feb 20, 11:21 am, "Gabriel Genellina" wrote: > 1) make the child window set a flag in the thread (let's say, t.terminate   > = True). And make the polling thread check the flag periodically (you   > possibly already have a loop there - just break the loop when you detect   > that self.terminate

Re: Killing subservient threads

2009-02-20 Thread jimzat
On Feb 20, 11:22 am, koranthala wrote: > > thread.setDaemon(True) > Makes it a daemon thread which means that interpreter will not stay > alive if only that thread is alive. My main window is used to launch multiple children and therefore when one is dismissed the interpreter will remain active.

Re: Killing subservient threads

2009-02-20 Thread Christian Heimes
Gabriel Genellina wrote: > 1) make the child window set a flag in the thread (let's say, > t.terminate = True). And make the polling thread check the flag > periodically (you possibly already have a loop there - just break the > loop when you detect that self.terminate became true) threading.Condi

Re: Killing subservient threads

2009-02-20 Thread koranthala
On Feb 20, 9:47 pm, jimzat wrote: > I am trying to create an app which will have a main window from which > the user will launch other (children) windows. > > When I launch the child window I start a new thread which periodically > polls another device and updates the child window accordingly.  Wh

Re: Killing subservient threads

2009-02-20 Thread Gabriel Genellina
En Fri, 20 Feb 2009 14:47:27 -0200, jimzat escribió: I am trying to create an app which will have a main window from which the user will launch other (children) windows. When I launch the child window I start a new thread which periodically polls another device and updates the child window acc

Killing subservient threads

2009-02-20 Thread jimzat
I am trying to create an app which will have a main window from which the user will launch other (children) windows. When I launch the child window I start a new thread which periodically polls another device and updates the child window accordingly. When I dismiss the child window the "polling"