[Stackless] threading.local analogue to tasklets

Arnar Birgisson arnarbi at gmail.com
Thu Jun 21 10:52:49 CEST 2007

Thank you Richard,

On 6/21/07, Richard Tew <richard.m.tew at gmail.com> wrote:
> On 6/20/07, Arnar Birgisson <arnarbi at gmail.com> wrote:
> > Is there something out there analogous to threading.local but for
> > tasklets instead of threads?
> >
> > I meant to port this [1] simple implementation but that means I would
> > have to assign properties to stackless.tasklet objects - which isn't
> > possible.
> I presume you mean attributes rather than properties.

Yes, I do :-P

> To prematurely dig an old Slashdot meme from its grave:
>  1. Create your own tasklet subclass.
>  2. Instance tasklets from it.
>  3. Set attributes on those instances.
>  4. ?
>  5. Profit!

Yes, I did that last night - well, steps 1-4 anyways :) Is there any
way to specify that my tasklet class should be used as the default
instead of stackless.tasklet? Is there any way to use a different
class than stackless.tasklet for the main tasklet?

Anyways.. I just keep one shared state for all tasklets that are not
derived from my custom one. As long as I have control over tasklet
creation, that should only be the main tasklet then.


Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list