[Stackless] Event-based scheduling
arnarbi at gmail.com
Wed Feb 13 22:17:26 CET 2008
On Feb 13, 2008 9:05 PM, Laurent Debacker <debackerl at gmail.com> wrote:
> I don't understand why the implementation forces me to use channels, if I do
> not need to 'transfer' data. You use the channel as a semaphore. I would
> think that it is better to implement semaphore, and then implement channels
> based on semaphores. Of course, it makes sense for coroutines exchanging
> data, but there is cases where no data need to be transfered. Of course, by
> semaphore, I mean semaphores working with the µthreads, not necessarily the
> ones of the kernel. I implemented the latter a while ago in C#.
Channels in Stackless are extremely light-weight, and yes - they are
often used just for tasklet synchronization (as semaphores). In this
case, just send "None" and discard the result from receive. No need
for another construct (semaphores) to complicate matters.
More information about the Stackless