"Austin Hastings" <[EMAIL PROTECTED]> wrote:
> 1. C<yield> always acts the same way -- stores args in CurThread.result
> and gives up control to [?something?].

I think you want a fifo on the output there -- at least conceptually.
"Stores args in .result" might overly block the producer thread.

"gives up control to" -- the "something" would be the scheduler that's
associated with the fifo. When you have a fifo, you don't need to switch
control on every iteration. In fact, if you're a thread on a multi-cpu
machine, you might never yield control. But at the other end of the
spectrum, a coro would optimize out the fifo and switch contexts every time.

Has any given thought to how the pipeline syntax of A6 might interact with
this stuff? How would we attach multiple output fifos to a "cothread"?
Multiple inputs?

cothread foo is input($a,$b,$c) is output($x,$y,$z)
{
  when $a { $x.yield $a+1 }
  when $b & $c { $y.yield $b+$c; $z.yield $b-$c }
}

Dave.


Reply via email to