It’s not atomic because it’s a multiple-step operation at the machine code level. That is, longs and doubles are longer than the processor’s word length.
More Related Contents:
- What’s the difference between Thread start() and Runnable run()
- ExecutorService that interrupts tasks after a timeout
- Volatile boolean vs AtomicBoolean
- What are the advantages of using an ExecutorService?
- What’s a monitor in Java?
- How to use ConcurrentLinkedQueue?
- Write a program that will surely go into deadlock [closed]
- Java threads and number of cores
- Java volatile reference vs. AtomicReference
- Memory effects of synchronization in Java
- Forcing multiple threads to use multiple CPUs when they are available
- Simplest and understandable example of volatile keyword in Java
- ThreadPoolExecutor Block When Queue Is Full?
- Initializing two threads with the same instance of a runnable
- Why does Java not see the updated value from another thread?
- Allowing the this reference to escape
- What is adaptive spinning w.r.t lock acquisition?
- How can I wrap a method so that I can kill its execution if it exceeds a specified timeout?
- Why are two AtomicIntegers never equal?
- How to demonstrate race conditions around values that aren’t published properly?
- Java, divide incoming work uniformly via hashing in multithreaded evnironments
- LinkedBlockingQueue vs ConcurrentLinkedQueue
- Java 8: Parallel FOR loop
- How to reduce java concurrent mode failure and excessive gc
- Setting Ideal size of Thread Pool [duplicate]
- Does a breakpoint halt all threads?
- Are arrays thread-safe in Java?
- What is optimum thread pool size for simple program running cpu based tasks in Java
- How to combine 3 or more CompletionStages?
- When is it preferable to use volatile boolean in Java rather than AtomicBoolean? [duplicate]