Multiple Instances Without Synchronization 非同步的多实例 ; 异步多实例
Provide a synchronization idiom that allows us to publish an object and have it be visible without synchronization.
提供一个同步习惯用法(idiom),以允许我们发布一个对象并且使得它不用同步就可见。
If both servlets are allowed to read and update the same state machine without synchronization, the state machine logic might not work.
如果允许这两个servlet读取和更新同一个状态机而无需同步,状态机逻辑可能不会工作。
The real value here is that the getWhatImReading method is executed without synchronization of any kind, whereas the setWhatImReading is executed as an atomic operation.
这里真正的价值在于,getWhatImReading 方法未经任何形式的同步便被执行,而 setWhatImReading 是作为一个原子操作执行的。
应用推荐