[Prev][Next][Index][Thread]

Re: Continuations?



In article 
<asynthREMOVE-240553.18461709112000@news-server.austin.rr.com>, James 
McCartney  <asynthREMOVE@THISio.com> wrote:

> > On the Mac, for example, threads libraries generally *are* coroutines.
> 
> Yes but you have no control over where the flow of control will go,
> the MacOS does. You are not able to simply switch between your own 
> coroutines. Thus it is very inefficient.

No, that's calling WaitNextEvent() -- I'm talking about calling yield() 
in a user-mode threads library, which switches you to a different thread 
*within* your application.

This has been around for nearly a decade as a standard library on the 
Mac -- so long that I remember that on 68K machines you actually had the 
choice of preemptive or non-premptive, but on the PowerPC only 
coroutines were offered.  (the multiprocessing API later brought back 
preemptive threads for PowerPC code (including on single-processor 
machines)).

-- Bruce



References: