[concurrency-interest] Clarification: volatile, final and atomic ops
joe.bowbeer at gmail.com
Thu Jan 15 18:50:41 EST 2009
On Thu, Jan 15, 2009 at 3:23 PM, Ashwin Jayaprakash wrote:
> I know I sound obtuse, but I'm wondering how, without knowing whether the
> next instruction - in this case the if(..) block and hence the volatile
> field access is going to be executed or not, can the compiler or CPU go
> ahead and re-order instructions that logically come after the if(..) block?
> I mean, can the instructions after the if(..) get executed even before the
> if(..) is evaluated and then realize that the if(..) is true and so requires
> a fence..so all the re-ordering and execution will have to be discarded...Is
> that how it works?
In terms of how, this might be what you're looking for:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest