Killing threads

Francesco Bochicchio bockman at virgilio.it
Sun Apr 5 06:54:45 EDT 2009


On Sat, 04 Apr 2009 22:45:23 -0700, ericwoodworth wrote:

> On Apr 5, 12:22 am, a... at pythoncraft.com (Aahz) wrote:
>> In article <4b52f7d7-81d5-4141-9385-ee8cfb90a... at l1g2000yqk.googlegroups.com>,
>>
>>  <ericwoodwo... at gmail.com> wrote:
>>
>> >I'm using queues to talk between these threads so I could certainly
>> >put some kind of message on the queue that causes the threads to
>> >commit suicide but I'm thinking there's a more built in way to do what
>> >I want.  I'm just not sure what it is.
>>
>> There isn't, you have the right idea about using queues.
>> --

> 
> Ok good to know.  I was letting the search for a really cool solution
> stop me from rolling out what I think I already know how to do.
> Thanks.

  
If yor threads are not set as 'deamons' using Thread.setDaemon method,
then your main program at its termination should call Thread.join for
each of the thread spawned, otherwise the whole process will not quit.

Ciao
----
FB 



More information about the Python-list mailing list