[concurrency-interest] memory barriers
Thu, 29 Jan 2004 10:30:21 +0100
I was wondering if there exist some documents about exactly when an
memory barrier is performed.
For example by reading http://gee.cs.oswego.edu/dl/cpj/jmm.html
A writing thread releases a synchronization lock and a reading thread
subsequently acquires that _same_ synchronization lock.
One get the impression that the following will not work
print(foo.i) //might read 4??
One really neat feature would be if ThreadGroup (and Thread) had a
(blocking) memorybarrier() method.
so when you did baseThreadGroup.memorybarrier you could rest assure that
all threads had fresh data.