Shared and race conditions
Steven Schveighoffer
schveiguy at yahoo.com
Wed Nov 29 16:53:46 UTC 2017
On 11/29/17 11:46 AM, Wanderer wrote:
> On Wednesday, 29 November 2017 at 16:33:50 UTC, Steven Schveighoffer wrote:
>> On 11/29/17 11:13 AM, Wanderer wrote:
>>> [...]
>>
>> [snip]
>>
>>> [...]
>>
>> Using the compiler switch -vcg-ast, I see no synchronization of these
>> methods.
>>
>> [...]
>
> That's what I assume, I was just lucky not to see a race.
> Thanks for `-vcg-ast` switch! Really helpful, and it answered my
> questions as no syncronization code was added.
FYI, I ran this about 15 times, finally got one:
Stevens-MacBook-Pro:testd steves$ ./testshared
next: MyId(1)
next: MyId(2)
next: MyId(3)
next: MyId(4)
next: MyId(5)
next: MyId(6)
next: MyId(7)
next: MyId(8)
next: MyId(9)
next: MyId(10)
next: MyId(11)
next: MyId(12)
next: MyId(12) <=== race
next: MyId(13)
next: MyId(14)
next: MyId(15)
next: MyId(16)
next: MyId(17)
next: MyId(18)
next: MyId(19)
next: MyId(20)
next: MyId(21)
next: MyId(22)
next: MyId(23)
Done
-Steve
More information about the Digitalmars-d-learn
mailing list