Re: ++x vs. atomicOp!"+="(x,1) with a shared int

2014-06-01 Thread Nordlöw
https://github.com/D-Programming-Language/dmd/pull/3070 Is this design for the sake of explicitness so the D developer doesn't unknowingly add dependencies on atomics? /Per

Re: ++x vs. atomicOp!"+="(x,1) with a shared int

2014-06-01 Thread Chuck Allison via Digitalmars-d
On Sunday, 1 June 2014 at 07:23:25 UTC, Meta wrote: It is a known bug with an open pull request to fix it. https://github.com/D-Programming-Language/dmd/pull/3070 Thanks!

Re: ++x vs. atomicOp!"+="(x,1) with a shared int

2014-06-01 Thread Meta via Digitalmars-d
On Sunday, 1 June 2014 at 07:06:27 UTC, Chuck Allison wrote: I was under the impression that calling ++x for a shared x is an error. Not only do I not get an error, the effect of ++x is identical to atomicOp"+="(x,1) in the following example (the variable is count here, not x): shared int cou

++x vs. atomicOp!"+="(x,1) with a shared int

2014-06-01 Thread Chuck Allison via Digitalmars-d
I was under the impression that calling ++x for a shared x is an error. Not only do I not get an error, the effect of ++x is identical to atomicOp"+="(x,1) in the following example (the variable is count here, not x): shared int count; void f(string s) { foreach (i; 0..100) writef