Asynchronicity in D

Sean Kelly sean at invisibleduck.org
Fri Apr 1 10:26:40 PDT 2011


On Apr 1, 2011, at 8:47 AM, dsimcha wrote:

> == Quote from Sean Kelly (sean at invisibleduck.org)'s article
>> 
>> It's more an issue of creating an understandable programming model.  If
>> someone is using statics, the result should be the same regardless of
>> whether the code gets a dedicated thread or is multiplexed with other
>> code on one thread.  ie. fibers are ideally an implementation detail.
> 
> Yes, but what would be the likely performance cost of doing so?

The cost of context-switching with fibers is significantly smaller than kernel threads--I think Mikola Lysenko's talk at the Tango conference a few years back may have some numbers.  The performance of using TLS in general isn't great regardless of whether fibers are involved.  Manually implemented TLS maybe requires one additional lookup?  TLS is done manually on OSX right now, so the code for how it would work is already in place.


More information about the Digitalmars-d mailing list