원자적 연산이란 i = i + 1 같은 여러 스레드가 연산 시킬 수 있는 게 아니라 i = 1 같이 완벽히 하나만 연산할 수 있는 것이다. 이런 방식은 여러 스레드가 접근해도 값이 변하지 않는다. 자바는 원자적 연산을 제공한다.아래 예시는 AtomicInteger와 AtomicBoolean 사용 예시 이다.package thread.cas.increment;import java.util.concurrent.atomic.AtomicInteger;public class MyAtomicInteger implements IncrementInteger { AtomicInteger atomicInteger = new AtomicInteger(0); @Override public synchronize..