L
L
litehaus2016-08-22 18:09:54
Java
litehaus, 2016-08-22 18:09:54

What optimizations does the java compiler not make when the variable is declared as Volotile?

Tell me what optimizations the Java compiler does not produce when declaring a variable as volotile.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
asurkis, 2016-08-22
@asurkis

The variable will definitely exist, there will be one for all threads, and all read-write operations for it will refer to it, and not to a local copy. Roughly speaking, there will be, in general, no optimizations
And yes, after all, volAtile, not volOtile

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question