[Stackless] TaskletExit Exception and Questions

Richard lickspittle at gmail.com
Wed Nov 30 15:14:00 CET 2005


I originally sent this just to Andrew, because gmail Reply replied to
him rather than the list.

This is what my application startup generally looks like (I guess you
could call it the main tasklet and it probably is):

 import stackless

 stackless.tasklet(someFunction)()

 while stackless.getruncount() != 1:
     stackless.run()

As the main tasklet counts as one running tasklet, any extras mean
that there are still tasklets running.  In fact, I tend to have a list
of tasklets that are sleeping to a given time, so my loop also checks
that is empty.  If I need to exit all the tasklets, because I use
cooperative scheduling, I just check in a given tasklet post block (I
know exactly where they will block) if it is still valid and if it is
not, exit.  But handling the tasklet exit exception is probably a much
better idea where possible.

On 11/29/05, Andrew Francis <andrewfr_ice at yahoo.com> wrote:
> Hello colleagues:
>
> Some code I wrote caused the Python intrepreter to
> crash.
> I decided to add exception handling and I caught the
> following
> error:
>
> (<class exceptions.TaskletExit at 0x00864D20>,
> <exceptions.TaskletExit instance at 0x008F4530>,
> <stackless.traceback object at 0x00A04B10>)
>
> I have a question:
>
> Does the main tasklet wait for other tasklets to
> finish before
> exiting? Or do I have to explicitly have to add my own
> (barrier)
> synchronisation?
>
> Cheers,
> Andrew
>
>
>
> __________________________________
> Start your day with Yahoo! - Make it your home page!
> http://www.yahoo.com/r/hs
>
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless
>

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list