Low-Lock Singletons In D

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon May 6 06:33:54 PDT 2013


On 5/6/13 5:06 AM, Mehrdad wrote:
> On Monday, 6 May 2013 at 02:35:33 UTC, dsimcha wrote:
>> that uses thread-local storage
>> On DMD the overhead of TLS vs. unsafe is noticeable but small. In both
>> cases it pales in comparison to the overhead of synchronizing on every
>> call to get().
>
>
> Hmm...
>
> So I just invented another method right now in like 10 minutes, which
> can completely avoid TLS altogether, and which I think might end up
> being faster.

It's well known. Needs a memory barrier on each access, so it's slower.

Andrei




More information about the Digitalmars-d mailing list