Java Threads Question
Related Post FastDateFormat How to Questions Auto Format & Clean up Code in Eclipse Java Overloading Overriding
Java Threads Question was originally published on

seen from Switzerland

seen from Germany
seen from United States
seen from China
seen from Japan

seen from Kuwait
seen from United States
seen from China

seen from Poland
seen from South Korea
seen from Türkiye

seen from Türkiye
seen from China
seen from United States
seen from Slovakia
seen from United States
seen from Thailand
seen from China
seen from China
seen from China
Java Threads Question
Related Post FastDateFormat How to Questions Auto Format & Clean up Code in Eclipse Java Overloading Overriding
Java Threads Question was originally published on
JAVA threads
For example, in the following (broken) code fragment, assume that this.done is a non-vol- atile boolean field:
while (!this.done) Thread.sleep(1000);
The compiler is free to read the field this.done just once, and reuse the cached value in each execution of the loop. This would mean that the loop would never terminate, even if another thread changed the value of this.done.