Difference between __gshared and shared.

wobbles via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 8 02:43:38 PDT 2015


On Wednesday, 8 July 2015 at 09:37:37 UTC, Olivier Pisano wrote:
> On Wednesday, 8 July 2015 at 09:20:58 UTC, wobbles wrote:
>> After reading the recent "Lessons Learned" article [1], and 
>> reading a few comments on the thread, there was a mention of 
>> using __gshared over shared.
>>
>> What exactly is the difference here?
>> Are they 2 keywords to do the same thing, or are there 
>> specific use cases to both?
>> Is there plans to 'converge' them at some point?
>>
>> [1] 
>> https://www.reddit.com/r/programming/comments/3cg1r0/lessons_learned_writing_a_filesystem_in_d/
>
> You can read it there : 
> http://dlang.org/migrate-to-shared.html#gshared
>
> Basically, __gshared is for interfacing with C (where 
> everything is shared by default) without marking data as shared.

Ok, so we should prioritise using 'shared' over __gshared as much 
as possible. Good to know!


More information about the Digitalmars-d mailing list