O'Reilly logo

Java 9 Concurrency Cookbook - Second Edition by Javier Fernández González

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

There's more...

You have four different access types to a variable with a variable handle:

  • Read mode: This is used to get read mode access to a variable. You can use the following methods:
    • get(): Read the value of the variable as if it was declared non-volatile
    • getVolatile(): Read the value of the variable as if it was declared volatile
    • getAcquire(): Read the value of the variable and guarantee that the following instructions that modify or access this variable are not reordered before the instructions for optimization purposes
    • getOpaque(): Read the value of variable and guarantee that the instructions of the current thread are not reordered; no guarantee is provided for other threads
  • Write mode: This is used to get write access mode ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required