Re: [Tutor] Killing a thread from main - was RE: "Lock"ing threads

2005-08-30 Thread Michael P. Reilly
On 8/29/05, Hans Dushanthakumar <[EMAIL PROTECTED]> wrote: Thanks KentHow do I send a signal from the main thread to stop execution of a childthread?I tried the foll:, but got an error:Other than by this method, is there any other mechanism to stop athread? import threadingimport timeclass shownum(

Re: [Tutor] Killing a thread from main - was RE: "Lock"ing threads

2005-08-29 Thread Kent Johnson
Hans Dushanthakumar wrote: > Thanks Kent > > How do I send a signal from the main thread to stop execution of a child > thread? You have the right idea - set some kind of flag that the thread checks - but you reused the name 'stop' so when you execute incr_num_thread.stop() you are retrieving t

Re: [Tutor] Killing a thread from main - was RE: "Lock"ing threads

2005-08-29 Thread Hans Dushanthakumar
Oops - the error was probably due to using 'stop' as a method name. :) -Original Message- From: Hans Dushanthakumar Sent: Tuesday, 30 August 2005 2:18 p.m. To: tutor@python.org Subject: Killing a thread from main - was RE: [Tutor] "Lock"ing threads Thanks Kent How do I send a signal

[Tutor] Killing a thread from main - was RE: "Lock"ing threads

2005-08-29 Thread Hans Dushanthakumar
Thanks Kent How do I send a signal from the main thread to stop execution of a child thread? I tried the foll:, but got an error: Other than by this method, is there any other mechanism to stop a thread? import threading import time class shownum(threading.Thread): def __init__(self

Re: [Tutor] killing a thread

2005-02-22 Thread Kent Johnson
Max Noel wrote: On Feb 22, 2005, at 23:08, Bill Mill wrote: If I recall correctly, there is not a direct way. Instead, you're going to want to have your worker thread check a queue it shares with the parent every so often to see if the supervisor thread has sent a "quit" message to it. Peace Bill M

Re: [Tutor] killing a thread

2005-02-22 Thread Max Noel
On Feb 22, 2005, at 23:08, Bill Mill wrote: If I recall correctly, there is not a direct way. Instead, you're going to want to have your worker thread check a queue it shares with the parent every so often to see if the supervisor thread has sent a "quit" message to it. Peace Bill Mill bill.mill at

Re: [Tutor] killing a thread

2005-02-22 Thread Bill Mill
If I recall correctly, there is not a direct way. Instead, you're going to want to have your worker thread check a queue it shares with the parent every so often to see if the supervisor thread has sent a "quit" message to it. Peace Bill Mill bill.mill at gmail.com On Tue, 22 Feb 2005 14:23:17 -

[Tutor] killing a thread

2005-02-22 Thread Shitiz Bansal
Hi, Is there a way to terminate a thread from another thread? Shitiz __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Tutor maillist - Tutor@