[fpc-devel] Light weight threads for FPC
Mark Morgan Lloyd
markMLl.fpc-devel at telemetry.co.uk
Mon Dec 17 14:39:01 CET 2007
Michael Schnell wrote:
> David Butler wrote:
>> A big difference between threads and fibers in Windows is that threads
>> are preemtively scheduled, while fibers are co-operatively scheduled.
> That sounds very logical.
>
> I gather cooperative scheduling is not possible when distributing the
> work on multiple processors. So using fibers are no option for the kind
> of "light weight threads" requested by the OP.
>>
>> Unfortunately, Windows' fiber implementation has severe limitations.
> No wonder :)
>>
>> To get around this I created a library that does real light-weight
>> "fibers".
> I suppose as they run in a single system thread they are no option for
> the kind of "light weight threads" requested by the OP.
Is there really much difference between what Windows terms "a fiber" and what
Modula-2 etc. terms "a coroutine"? A thread is little more than a
preemptively-scheduled coroutine, and it's always seemed slightly perverse to
define fibers in terms of threads rather than the other way round.
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
More information about the fpc-devel
mailing list