[Stackless] multiple channel waits

Christian Tismer tismer at tismer.com
Thu Aug 15 19:21:39 CEST 2002

Aaron Watters wrote:
>> Multiple channel wait is hard for me to understand completely.
>> I want to do it right, once and forever. I need to do a KQueue
>> like formulation. KQueue is unbeatable. 
> We're opposites.  KQueue is hard for me to understand.  Multiple channel
> waits are easy.

Sure. This is since they are easy and wrong.

All operations in Stackless are O(1) now, and I want
to keep it.
Select is O(number of channels), KQueue is O(number of activities).
I'm absolutely happy to implement select *upon* that,
but providing it now without giving the other as well
is impossible for me.

> In Limbo the semantics was that you wait on any number of channels
> and when some of them become available you get one channel back
> (if I recall correctly).  That way if there are 5 tasklets each waiting on
> the same 5 channels they all can be made runnable at once if all 
> channels get
> full..  Higher level programming tricks are needed to prevent things
> like starvation, etcetera.  I think this is a reasonable approach for the
> primative.

Yes, I agree. No objection. I just don't think of
select() as a primitive.

> Maybe
>      (chosenChannel, message) = stackless.receiveFromChoice([c1, c2, c3, 
> c4])
> blocks until one or more of the cns is available and assigns one to this
> tasklet, returns the chosen channel and the message sent on the channel.

Maybe. I think of some "waitOnActivity(channelset)", and the channel
set is created elsewhere, together with filters like in Limbo and
Occam. The reason is that I want do do really huge channel lists.


> ps: I'm beginning to fantasize about things like robotics and factory
>  floor automation with this stuff :).


have you ever had a look at EVE? http://www.eve-online.com
They do everything with tasklets now.
It's becoming fun :-)

ciao - chris

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/

Stackless mailing list
Stackless at www.tismer.com

More information about the Stackless mailing list