Prev Next

Java / volatile

Practical uses of volatile modifier.

  • enable reading/writing into double/long as atomic.
  • volatile variable enables Java memory model to have memory barrier so that when write is performed on a volatile variable it is guaranteed that any thread accessing that thread will see the value written.

More Related questions...

Show more question and Answers...


Comments & Discussions