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, but local variables aren't automagically »thread local« in any sense – the fact that value is implicitly heap-allocated due to the closure does not change that.

David

Reply via email to