Std::thread::join is said to \'synchronize-with\' the joined thread, however synchronization doesnt tell anything about visibility of side effects, it merely governs the ord
t1.join() will not return until thread execution is completed, so from your example g_i is guaranteed to be 1
t1.join()
g_i