What exactly shared means?

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 3 04:17:40 PST 2015


On Sat, 03 Jan 2015 12:14:54 +0000
via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com> wrote:

> On Saturday, 3 January 2015 at 00:12:35 UTC, Jonathan M Davis via 
> Digitalmars-d-learn wrote:
> > In D, if a type is not marked as shared, then it is by 
> > definition
> > thread-local, and the compiler is free to assume that it's 
> > thread-local.
> 
> I find this to be rather vague. If the compiler exploit this to 
> the maximum wouldn't that lead to lots of bugs?

why should it? thread locals are... well, local for each thread. you
can't access local of different thread without resorting to low-level
assembly and OS dependent tricks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150103/09e0be9f/attachment.sig>


More information about the Digitalmars-d-learn mailing list