[Stackless] Re: Stackless API

Christian Tismer tismer at stackless.com
Thu Feb 5 17:32:32 CET 2004

Oren Tirosh wrote:

> On Tue, Feb 03, 2004 at 06:50:06AM -0300, Esteban U. Caamano Castro wrote:
>>>I gues that raising a bomb on a channels is not the
>>>common action unless you are the roadrunner coyote,
>>>so maybe it would be most efficient to use a special
>>>object as a marker flag? This object could be solely
>>>to channels.
>>Yes, this is Tirosh' proposal.

Ah. As it seems my brain was blocked :-)


> Exactly. Except that it's going to be in C and checking the type can take
> about a nanosecond: if (result->ob_type == ExceptionWrapperType). It's even
> faster than the current code: if (Py_IsInstance(result, PyExceptionType))
> that makes a function call and checks if the object is somehow descended 
> from Exception. It's ok to check the type directly because this type is not
> subclassable or even visible.

Well, I think this is a good argument for a C implementation,
and maybe I can decouple things to keep send/receive still
shorter than they are now.

On the other hand, I like sample implementations like these.
Please let us keep them and put them somewhere on the web
page, since this is good documentation.
I'm going to give write access to some volunteers to a Zope
site in the next few days.

Almost all of a channel can be written in Python, and I also
think to support this by adding some functionality to tasklets
(via _method names) that allows to control their chaining
and blocking. That makes a channel implemented in Python
behave like a "real" channel.

ciao - chris

Christian Tismer             :^)   <mailto:tismer at stackless.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  mobile +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/

Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list