In Java, reading and writing 32-bit or less is guaranteed to be atomic.
By atom we mean that each action takes place in one step and cannot be interrupted. Thus, when we have multithreaded applications, the read and write operations are thread safe and do not require synchronization.
For example, the following code is a safe stream:
public class ThreadSafe { private int x; public void setX(int x) { this.x = x; } }
Javascript is GOD Jan 30 '11 at 2:25 2011-01-30 02:25
source share