반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- ElasticSearch
- 코딩테스트
- AbsDistinct 풀이
- ELK
- urllib3
- flow chart
- collect
- ES Query
- java set
- mkdirs
- Collectors.toMap
- Elastic Stack
- intervals
- 5amsung
- AbsDistinct java
- AbsDistinct
- codility
- java
- 카드모으기 자바
- draw.io down
- es test data
- analyze api
- Draw.IO
- Warnings
- high level client
- elasticsearch java
- low level client
- https warning
- es
- mkdir
Archives
- Today
- Total
5AMSUNG
[java] AtomicInteger 본문
반응형
AtomicInteger 여러 스레드에서 동시에 액세스할 수 있는 다중 스레드 환경에서 원자 정수 카운터로 사용할 수 있는 Java의 클래스입니다.
AtomicInteger는 synchronized 보다 적은 비용으로 동시성을 보장할 수 있습니다.
y = atomic.get(); -> y = i;
y = atomic.incrementAndGet(); -> y = ++i;
y = atomic.getAndIncrement(); -> y = i++;
y = atomic.decrementAndGet(); -> y = --i;
y = atomic.getAndDecrement(); -> y = i--;
y = atomic.addAndGet(x); -> i = i + x; y = i;
y = atomic.getAndAdd(x); -> y = i; i = i + x;
atomic.set(x); -> i = x;
y = atomic.getAndSet(x); -> y = i; i = i + x;
반응형