[Stackless] multiple channel waits

Sam M. Rushing srushing at ironport.com
Thu Aug 15 23:25:14 CEST 2002


> -----Original Message-----
> From: Ctismer (forward) 
> Sent: Thursday, August 15, 2002 10:22 AM
> To: Aaron Watters
> Cc: stackless at tismer.com
> Subject: Re: [Stackless] multiple channel waits
> 
> 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 right, I think I'm confused now.  I didn't see this as a big
problem...
I thought a multi-channel-wait was very similar to a condition variable.
Which is easy to do with coroutines, and should be easy to do with
channels.

You would have multiple threads block waiting on a condition, and some
other
thread will come along and wake up one or more of them.  Couldn't this
just
be done with a channel that waits for an integer - telling it how many
to wake up?

-Sam

p.s. Chris, if you need to get a handle on kqueue, there's a much
simpler
version of the scheduler etc... in the 'bench' subdirectory.  The C++
version
is more filled out (the dispatcher mechanism supports kqueue, poll, and
select),
whereas the C version is kqueue-only.  We discarded the C++ version
because
libcoro didn't get along with C++ exceptions (something that should
sound
familiar to you! 8^)



More information about the Stackless mailing list