|
|
|
|
|
by the8472
2585 days ago
|
|
The standard pattern for working with atomics in java (volatiles are of limited use without atomic field updaters or varhandles) is to read it into a local variable, operate on that and only write it back to the volatile once you're done. That has many benefits, among them the ability to store its value in registers. |
|