Volatile fields

A volatile qualifier on a field in Java imposes stricter memory semantics. Declaring a field volatile guarantees that all threads immediately see the same contents of the field after it has been written to.

See also Java Memory Model.

Get Oracle JRockit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.