Category "volatile"

Volatile reference to mutable object - will updates to the object's fields be visible to all threads

... without additional synchronization ? The Tree class below is meant to be accessed by multiple threads (it is a singleton but not implemented via an enum) c

Can using volatile affect the behavior of simple property checking system?

I'm maintaining a project where someone has suggested that we make some variables volatile. I'm trying to understand if it's needed at all (or could be needed).

Does the semantics of java volatile guarantee that wrong results will not appear? (Two threads write first and then read)

volatile x=y=0 Thread1 x=1 r1=y Thread2 y=1 r2=x r1 and r2 are local variables Question1: Is the result of r1==r2==0 illegal and does not appear? All stateme

What serves the same purpose of Java volatile in C++?

I learned the volatile keyword in Java. It serves as a mean to ensure visibility in other threads when a variable is written by one particular thread. It does t

Why is volatile deprecated in C++20?

According to cppreference, most uses of the volatile keyword are to be deprecated in C++20. What is the disadvantage of volatile? And what is the alternative so

Why false share not work without volatile padding

public class VolatileTest { private static class T { public long p1,p2,p3, p4,p5;// if comment this and run again public long x = 0L; public