Shared Hell
Walter Bright
newshound1 at digitalmars.com
Wed Oct 28 03:17:43 PDT 2009
Denis Koroskin wrote:
> I've recently updated to DMD2.035 (from DMD2.031 because all the later
> versions had issues with imports) and for the first time faced problems
> with shared modifier.
>
> I don't need shared and all my globals are __gshared (they are globally
> unique instances that don't need per-thread copies).
I don't understand. Are you running multiple threads? Are those threads
accessing globals?
A function that accesses shared data has to put in fences. There's no
way to have the same code deal with shared and unshared code.
As an escape from the type system, you can always cast away the
shared-ness. But I wonder about code that both uses global variables
shared across threads that don't need synchronization?
More information about the Digitalmars-d
mailing list