Re: Is there a comprehensible on-line reference?
- From: "Rob Thorpe" <robert.thorpe@xxxxxxxxxxxx>
- Date: 18 May 2006 09:08:15 -0700
Alf P. Steinbach wrote:
Good luck on the coroutines, they are nice. But I don't know what high
level, readily available, languages support them.
Modula-2 supported coroutines, so I guess Modula-2 and Oberon also do.
There is at least one coroutine library for Java, based on Java threads:
restricting a thread to act like a coroutine simplifies many things.
There used to be a number of coroutine libraries for C and C++ (I made
one myself), based on e.g. longjmp + a few assembly instructions.
The old Windows 16-bit API treated each "task" (instance of a program)
as a coroutine, except for DOS-boxes.
Modern Windows supports co-routines directly and calls them "fibers".
You can make them available in Lisp and scheme with a ~50 line macro.
They can be done in Python and Haskell too with a little trickiness.