Fibers and inp()/outp() in Tango

Sean Kelly sean at f4.ca
Fri Aug 17 08:19:40 PDT 2007


Ingo Oeser wrote:
> Sean Kelly wrote:
>> 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.
> 
> Hmm, so that stuff was implemented without proper (performance) 
> analysis on whether it is really beneficial and just for the hack of it :-)

Well, the reason for adding Fibers to Tango was partially for its 
ability to encapsulate state and make it transferable across threads. 
Also, using fibers can eliminate the need for mutexes, which is a nice 
perk.  Perhaps most importantly is that the schedulers for some 
concurrency models like having fibers available to provide more 
multiplexing options.  Mik's DCSP uses them, for example.

> 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.

> BTW: I see Unix signal handling is widely ignored in tango, is that true?
>         I can imagine why.

Tango uses signals to coordinate garbage collection, but that's about 
it.  I think signals are quite useful in some instances, but they're too 
limited and too expensive to be a general-purpose tool.


Sean



More information about the Digitalmars-d mailing list