Fibers and inp()/outp() in Tango
Sean Kelly
sean at f4.ca
Fri Aug 17 08:37:36 PDT 2007
Sean Kelly wrote:
> Ingo Oeser wrote:
>
>> Ok, here is a link to someone who did more analysis with that kind of
>> stuff and documented some pitfalls with it.
>>
>> http://tservice.net.ru/~s0mbre/old/?section=projects&item=threading
>>
>> He did it under Linux.
>
> Thanks, I'll check it out.
Interesting article. It sounds like he implemented green threads using
signals. I do sort of wonder what in the design necessitated signals,
but I trust that there's a reason. Fibers in Tango are perhaps a bit
less fancy but are more efficient in exchange, as they are scheduled
cooperatively (ie. you must call Fiber.yield() to switch Fiber
contexts). This makes them useful for certain specialized programming
tasks, but reduces their utility as a general programming tool because
of the necessity for the yield call. The important bit is really that
they are integrated with the GC scanning mechanism, which would have
been difficult to do if they were offered as a third-party extension to
Tango.
Sean
More information about the Digitalmars-d
mailing list