Stackless goes Limbo

Christian Tismer tismer at tismer.com
Thu Apr 25 07:43:53 EDT 2002


Terry Reedy wrote:
> "Christian Tismer" <tismer at tismer.com> wrote in message
...

>>Besides the tasklets, there are "channel" objects,
>>which allow for communication between tasklets.
>>This approach is simple and powerful. Blocking of
>>tasklets takes place on writes when no tasklet
>>is listening, or on reads, when no data is available.
> 
> 
> Whatever else you do, please consider adding an iterator interface for
> reading channels:
> 
> for item in channel: whatever()

Sure. Pipes are nice.

> Also nice, but probably much harder, would be to hijack 'yield' to
> write to a channel (for tasklets that write to only one channel, or
> which have a default output channel).

Yes. I already hijacked yield in my first attempt.
Before I became familiar with channels, I was always
thinking around generators and coroutines. For yield,
I had a "client" field as the implicit destination.
Replacing this with an implicit channel would be
quite easy, and the overhead would be neglectible.

Where I still have problems to get things clear is
how to handle exceptions.
With tasklets, waiting on some channel, this is
no question. The tasklets are on their own, and
they handle their exceptions alone.
But what about generators/coroutines? They look
tighter coupled, and I'm not so sure who has
to handle exceptions. On a yield or coroutine
transfer, it looks like a caller/callee situation,
where exceptions might be propagated.

Any ideas?

-- 
Christian Tismer             :^)   <mailto:tismer at tismer.com>
Mission Impossible 5oftware  :     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 89 09 53 34  home +49 30 802 86 56  pager +49 173 24 18 776
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 Python-list mailing list