Re: unsynchronized access to primitive variables

2012-05-23 Thread Steven Schveighoffer
On Sat, 19 May 2012 04:16:39 -0400, luka8088 luka8...@owave.net wrote: Hello to all, I would like to know if D guarantees that access to primitive variable is atomic ? I was looking for any source of information that says anything about unsynchronized access to primitive variables. What

Re: unsynchronized access to primitive variables

2012-05-20 Thread Dejan Lekic
On Saturday, 19 May 2012 at 08:16:39 UTC, luka8088 wrote: Hello to all, I would like to know if D guarantees that access to primitive variable is atomic ? I was looking for any source of information that says anything about unsynchronized access to primitive variables. What I want to know

Re: unsynchronized access to primitive variables

2012-05-20 Thread David Nadlinger
On Sunday, 20 May 2012 at 13:51:45 UTC, Dejan Lekic wrote: This proggy will always print 1 because writeln() prints the value from the main thread. Spawned thread will have own value. Remember TLS is the default storage. This is wrong. _Global_ (or static) variables are in TLS by default,