[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
> > 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
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
You would have multiple threads block waiting on a condition, and some
thread will come along and wake up one or more of them. Couldn't this
be done with a channel that waits for an integer - telling it how many
to wake up?
p.s. Chris, if you need to get a handle on kqueue, there's a much
version of the scheduler etc... in the 'bench' subdirectory. The C++
is more filled out (the dispatcher mechanism supports kqueue, poll, and
whereas the C version is kqueue-only. We discarded the C++ version
libcoro didn't get along with C++ exceptions (something that should
familiar to you! 8^)
More information about the Stackless