Threads don't scale, processes do - Fibers
Christopher Wright
dhasenan at gmail.com
Wed Aug 27 16:11:00 PDT 2008
Oliver Dathe wrote:
> > Fibers (as well as Java’s green threads) are not an alternative to
> > heavyweight threads. Fibers can’t run in parallel, so they have no
> > way to use multiple processors. They are more of a flow-of-control
> > construct, often used interchangeably with coroutines.
>
> Fibers can be passed between Threads as long as they are not currently
> executing. This may be implementationdepended but generally seems not to
> be the big issue. See tango's Fibers.
>
> I frequently thought about a model where you got an applicationdepended
> Scheduler/Proxy/Supervisor S which interchanges a set of Fibers between
> a set of Threads - controlled on each yield(). It is based on the
> following scenario:
I find the concept of userland scheduling and green threads interesting
and would work on this with you if you wish.
Interpreted languages such as Erlang can pause their green threads /
green processes easily; not so with natively compiled code. This may be
one of the largest issues with scheduling native fibers. You might be
able to get around it with enough hacks, though some would have to
involve your OS's kernel, I have no doubt.
More information about the Digitalmars-d
mailing list