On Mon, 10 Jun 2013 09:38:43 -0400, Sergei Nosov <sergei.no...@gmail.com> wrote:

Hi!

I'm puzzled with what's the difference between shared and __gshared.

shared is part of the type, __gshared is not.

The danger of __gshared is that the compiler treats it as if it were not shared. You better know what you are doing, lots of code expects that anything not marked as shared is thread-local.

shared was supposed to infer memory barriers, but AFAIK, it doesn't do that. Not sure it ever will.

-Steve

Reply via email to