shared - i need it to be useful

Nicholas Wilson iamthewilsonator at hotmail.com
Wed Oct 17 16:27:00 UTC 2018


On Wednesday, 17 October 2018 at 15:51:04 UTC, Steven 
Schveighoffer wrote:
> On 10/17/18 9:58 AM, Nicholas Wilson wrote:
>> On Wednesday, 17 October 2018 at 13:25:28 UTC, Steven 
>> Schveighoffer wrote:
>>> It's identical to the top one. You now have a new unshared 
>>> reference to shared data. This is done WITHOUT any 
>>> agreed-upon synchronization.
>> 
>> It isn't, you typo'd it (I originally missed it too).
>>> int *p3 = cast(int*)p2;
>> 
>> vs
>> 
>>> int *p3 = p;
>
> It wasn't a typo.

The first example assigns p2, the second assigns p (which is 
thread local) _not_ p2 (which is shared), I'm confused.



More information about the Digitalmars-d mailing list