[Stackless] multiple channel waits

Aaron Watters aaron at reportlab.com
Thu Aug 15 17:16:37 CEST 2002


>
>
> 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.

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.

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.

   -- Aaron Watters

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




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



More information about the Stackless mailing list