반응형
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
- java
- ES Query
- draw.io down
- urllib3
- https warning
- es test data
- low level client
- AbsDistinct
- 코딩테스트
- high level client
- Warnings
- Draw.IO
- intervals
- AbsDistinct java
- ELK
- 5amsung
- 카드모으기 자바
- Elastic Stack
- analyze api
- es
- java set
- mkdir
- Collectors.toMap
- flow chart
- ElasticSearch
- mkdirs
- codility
- elasticsearch java
- AbsDistinct 풀이
- collect
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;
반응형