[Stackless] tasklets on threads

Kristján Valur Jónsson kristjan at ccpgames.com
Thu Sep 8 17:04:59 CEST 2011



> -----Original Message-----
> From: stackless-bounces at stackless.com [mailto:stackless-
> bounces at stackless.com] On Behalf Of Richard Tew
> Sent: 8. september 2011 14:01
> To: The Stackless Python Mailing List
> Subject: Re: [Stackless] tasklets on threads
> 
> 2011/9/8 Kristján Valur Jónsson <kristjan at ccpgames.com>:
> > Well, we don't keep track of tasklets anywhere.
> 
> No?  What goes on at interpreter shut down?  Don't we go through the list of
> tasklets in some function there killing them?  I seem to recall fixing a crash
> bug there at some stage in the past.
tasklets are killed if their reference goes to zero and they are still alive.  I think we rely on reference counting to do their job.
> 
> 

> What are the repercussions of keeping a tasklet alive, but killing the cstate
> from underneath it?  It sounds a bit.. sloppy, or maybe I am missing
> something?
It would become dead, or zombie, or something. 
Well, if a thread dies and its tasklets are still in existence, then there is nothing we can do.
I think we can make things not crash by being more rigorous with the cstate->tstate but we
probably ought to leave it up to the developer to kill all his tasklets if his main tasklet (on a thread) is exiting.
Otherwise, they would silently die...
K



More information about the Stackless mailing list