Re: Killing a Thread

2010-01-29 Thread Gabriel Genellina
En Thu, 28 Jan 2010 10:25:30 -0300, Richard Lamboj escribió: which Method is better to kill a Thread? Using Thread Events, or a raising a Exception? Maybe someone has a small example for me? The best way is simply NOT to do that. You don't kill a thread, you ask it to commit suicide. T

Killing a Thread

2010-01-29 Thread Richard Lamboj
Hello, which Method is better to kill a Thread? Using Thread Events, or a raising a Exception? Maybe someone has a small example for me? Kind Regards, Richi -- http://mail.python.org/mailman/listinfo/python-list

Re: Killing a thread

2006-06-12 Thread Antoon Pardon
Op 2006-06-10, Carl J. Van Arsdall schreef <[EMAIL PROTECTED]>: > Felipe Almeida Lessa wrote: >> Em Sex, 2006-06-09 às 13:54 -0700, Manish Marathe escreveu: >> >>> On 6/9/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >>> Manish Marathe wrote: >>> >>> > I am creating threa

Re: Killing a thread

2006-06-11 Thread Fredrik Lundh
MacDonald wrote: >> I'm not sure using a non-portable API to run the code under a "custom >> debugger" qualifies as a "portable implementation", though... > > Everything used is a part of the standard library, which is portable, > AFAICT. Could you say specifically what is non-portable? from the

Re: Killing a thread

2006-06-11 Thread MacDonald
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > >> it cannot be done in a portable way, so that's not very likely. > > > def __run(self): > > """Hacked run function, which installs the trace.""" > > sys.settrace(self.globaltrace) > > self.__run_backup() > > self.run = self.__r

Re: Killing a thread

2006-06-10 Thread Diez B. Roggisch
> Python uses the underlying OS thread implementation. It does _not_ spawn > new threads. Obviously that was meant to be "spawn processes" Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Killing a thread

2006-06-10 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: >> it cannot be done in a portable way, so that's not very likely. > def __run(self): > """Hacked run function, which installs the trace.""" > sys.settrace(self.globaltrace) > self.__run_backup() > self.run = self.__run_backup I'm not sure using a non-p

Re: Killing a thread

2006-06-10 Thread crazymykl
Fredrik Lundh wrote: > Carl J. Van Arsdall wrote: > > > Are there any plans in the future to add the capability to kill threads > > from the outside? > > it cannot be done in a portable way, so that's not very likely. > import sys, trace, threading class KThread(threading.Thread): """A subclas

Re: Killing a thread

2006-06-10 Thread Diez B. Roggisch
> Are there any plans in the future to add the capability to kill threads > from the outside? Better yet, an interruptable thread so instead of > using a polling loop you could send a DIE_THREAD_DIE signal or > something. I think at present its not possible (or a really bad idea) > to put sig

Re: Killing a thread

2006-06-10 Thread Fredrik Lundh
Carl J. Van Arsdall wrote: > Are there any plans in the future to add the capability to kill threads > from the outside? it cannot be done in a portable way, so that's not very likely. > I noticed that each python thread spawns a new interpreter are you sure? what Python version and OS is th

Re: Killing a thread

2006-06-09 Thread Carl J. Van Arsdall
Felipe Almeida Lessa wrote: > Em Sex, 2006-06-09 às 13:54 -0700, Manish Marathe escreveu: > >> On 6/9/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> Manish Marathe wrote: >> >> > I am creating threads using my self defined class which >> inherits the >>

Re: Killing a thread

2006-06-09 Thread Felipe Almeida Lessa
Em Sex, 2006-06-09 às 13:54 -0700, Manish Marathe escreveu: > On 6/9/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Manish Marathe wrote: > > > I am creating threads using my self defined class which > inherits the > > threading.Thread class. I want to know

Re: Killing a thread

2006-06-09 Thread Manish Marathe
On 6/9/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Manish Marathe wrote:> I am creating threads using my self defined class which inherits the> threading.Thread class. I want to know how can I kill the threads which> are being created by the object of my self defined class. you cannot kill a threa

Re: Killing a thread

2006-06-09 Thread Fredrik Lundh
Manish Marathe wrote: > I am creating threads using my self defined class which inherits the > threading.Thread class. I want to know how can I kill the threads which > are being created by the object of my self defined class. you cannot kill a thread "from the outside"; you have to design your

Killing a thread

2006-06-09 Thread Manish Marathe
Hello, I am creating threads using my self defined class which inherits the threading.Thread class. I want to know how can I kill the threads which are being created by the object of my self defined class. Thanks -- Manish MaratheSpikeSource, Inc.http://developer.spikesource.com -- http://mail.p