trying to kill threads

Jp Calderone exarkun at intarweb.us
Fri Feb 7 19:04:18 EST 2003


On Fri, Feb 07, 2003 at 07:06:50PM -0500, anton wilson wrote:
> 
> I'm trying to figure out how to kill a python thread in a way that won't 
> trash the interpreter or memory. I have a program that allows a user to use 
> our pre-defined python functions to create threads and run his/her own 
> function. But when the stop button is pressed, I want to get rid of the 
> threads the user created fairly quickly. 
> 
> I'm sure every understands the futility of using kill() with python.
> 

  Have your threads poll queue objects.  When you want them to die, toss an
object that indicates this into their queue.

  This has been discussed several times in the last few weeks.  A search on
groups.google.com will result in more details.

  Jp

-- 
It is practically impossible to teach good programming style to
students that have had prior exposure to BASIC: as potential
programmers they are mentally mutilated beyond hope of
regeneration.        -- Dijkstra
-- 
 up 54 days, 3:50, 4 users, load average: 0.30, 0.19, 0.08
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030207/7feba597/attachment.sig>


More information about the Python-list mailing list