[Stackless] Creating a relation between tasklets to forward exceptions

Gabriel Lavoie glavoie at gmail.com
Sun Sep 5 21:06:59 CEST 2010

Hello Richard,
     I tried to contact Christian on IRC but he has been a bit unavailable
lately (I know why... not necessary to tell me). Thanks for the hints about
how to manage this problem with Stackless. On my side, it doesn't help that
much because I have to work with many tasklets executed on different
interpreters but still exchanging data through channels. The idea of my
Master Degree project is to make Stackless Python distributed with easy
tasklet migration between interpreters. It's not perfect but right now I
have hybrid channels that can exchange data between local or remote
tasklets. I made some kind of distributed objets using PyPy proxy object
space for objets that shouldn't be copied when they are sent to a remote
tasklet (like big objects). I also tried to manage the best I could the case
of global memory and shared object. This could still be improved.

The idea of creating a parent/child relation between tasklets is manage the
case when two tasklets in relation are not executed on the same interpreter.
If the remote tasklet dies or the interpreter where it was executed dies,
the parent tasklet should be notified in some way. Trying to manage this
with a weakref would be a nightmare for the programmer if the remote tasklet
moves a lot between interpreters. I want this to be managed by my library.
Also trying to wrap the function used to create a tasklet isn't really
useful when the interpreter running it dies and the parent is elsewhere. In
any case, the way you described to do it is still some useful material for
my thesis. ;)

See ya,


2010/9/1 Richard Tew <richard.m.tew at gmail.com>

> On Thu, Sep 2, 2010 at 9:37 AM, Gabriel Lavoie <glavoie at gmail.com> wrote:
> > If there really isn't any way to create a relation between tasklets to
> > forward exceptions with Stackless Python, why such a decision was made
> (if
> > it was)? I'm just curious and I need to explain this in my thesis.
> Only Christian could answer that question to give you an authoritative
> answer.
> The natural Pythonic way to create this relation, would be to use weak
> references taking advantage of the callbacks they provide, to detect
> when a tasklet exits and is cleaned up.
> Of course, generally people need to wrap functions that are passed to
> newly started tasklets so that any exceptions raised within them that
> are not TaskletExit related, are not raised out of the scheduler
> interrupting it.  But that fits in with the general theme of Stackless
> being a barebones framework which people need to do a minimal amount
> of work with to make best use of it.
> Cheers,
> Richard.
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless

Gabriel Lavoie
glavoie at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20100905/ab677872/attachment.html>

More information about the Stackless mailing list