Thread 2 in Listing 2 is for taking multiple snapshots over the period without issuing the reset monitor command after the initial reset monitor command.
清单2中的线程2用于在整个时间段内拍摄多个快照,在初始复位监控器命令之后没有发出复位监控器命令。
When a thread exits a synchronized block as part of releasing the associated monitor, the JMM requires that the local processor cache be flushed to main memory.
当线程为释放相关监视器而退出一个同步块时,J MM要求本地处理器缓冲刷新到主存中。
Most programmers know that the synchronized keyword enforces a mutex (mutual exclusion) that prevents more than one thread at a time from entering a synchronized block protected by a given monitor.
大多数程序员都知道,synchronized关键字强制实施一个互斥锁(互相排斥),这个互斥锁防止每次有多个线程进入一个给定监控器所保护的同步语句块。
应用推荐