jvm reordering/visibility effect test
问题 While writing some java article I'm trying to reproduce re-ordering in case of unsynchronized object costruction in multithreaded environment. The case when a heavy object is constructed w/o synchonization/volatiles/finals and other threads get access to it right after constructor call. Here is the code I try: public class ReorderingTest { static SomeObject<JPanel>[] sharedArray = new SomeObject[100]; public static void main(String[] args) { for (int i = 0; i < 100; i++) { String name =