[Stackless] killing tasklets

Christian Tismer tismer at stackless.com
Fri Nov 23 00:24:26 CET 2007

Kristján Valur Jónsson wrote:

> The thing is, we are killing tasklets.  We use t.kill() to do this.  
> However, sometimes, the tasklet t hasn‘t even had the time to run yet.  
> In which case, it won‘t get its kill() thingie.

Not sure if that's reflected by the alive property.
In any case, if it has never been run, then it's frame
attribute is empty.

> How can we recognize that a tasklet hasn‘t run yet from its flags?  In 
> this case, we want to make it run before killing it so that we can 
> properly „wait“ on its finish.

> Alternatively, we could just remove() it, right?

Yes you can.

> At any rate, how can we recognize such a tasklet?

We can have another flag, probably a computed one,
if it is useful.

But simply ignoring this and killing right away should
be fine in this case.

cheers - chris
Christian Tismer             :^)   <mailto:tismer at stackless.com>
tismerysoft GmbH             :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56  mobile +49 173 24 18 776  fax +49 30 80 90 57 05
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
       whom do you want to sponsor today?   http://www.stackless.com/

More information about the Stackless mailing list