Fibers and inp()/outp() in Tango

Sean Kelly sean at f4.ca
Mon Jul 30 13:07:53 PDT 2007


Ingo Oeser wrote:
> 
>>> Did you measure your claim? Did you dirty the caches
>>> (aka "use the state of the state machine"), before context switching?
>> Nope.  But Mikola Lysenko, the author of StackThreads on which Tango
>> fibers are based performed some tests when developing coroutines and his
>> StackThreads were substantially faster for multiplexing tasks.
> 
> Didn't find his measurements either (using Google, Mikola Lysenko 
> StackThreads). Do you have a pointer somewhere? Did he bother to measure
> that on Linux, which is known for low context switching latency?

The timings I recall were mentioned in an IRC conversation about the 
performance of his coroutines over a similar test program implemented 
with threads.  I would guess the tests were run on Windows, but couldn't 
tell you the numbers offhand.

> Oh, and looking at the implementation, I see currently MORE global state
> in Tango due to Fibers. I mean the hacks for "Context".

Right.  That's done to integrate GC scanning with Fibers.  Each thread 
effectively has a default context and fibers each present their own 
context as well.  But I'm not sure I see any way around this, as the 
need to scan memory is a requirement for nearly all GC mechanisms.


Sean



More information about the Digitalmars-d mailing list