there is a volatile attribute in the netty internal logging framework InternalLoggerFactory that defaultFactory, does not understand why the volatile keyword is added, and if it is to implement a singleton, why not add the getDefaultFactory method in th...
public class TestClass { int i = 0; volatile boolean tmpvo = false; public void one() { i = 1; tmpvo = true; } public void two() { if(tmpvo) { int j = i; ...... } } } suppose that after the one () metho...
for unprotected multithreads, it is uncertain when some data is modified in one thread and when it is submitted to main memory, and the values used by other threads are not necessarily up-to-date. in the case of volatile modification, it is guaranteed t...