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 |
Tags
- 5582 파이썬
- 1806 파이썬
- android hilt
- git local remote
- 이진 탐색
- 자료구조
- flow buffering
- Android Room
- 1753 파이썬
- Coroutine Flow
- 1806 백준
- 1806 투포인터
- 백준 1644
- 안드로이드 hilt
- 6588 파이썬
- Android mvp
- 백준 2096
- 코루틴 플로우
- 10819 파이썬
- 투포인터 알고리즘
- 백준 5582
- 1644 파이썬
- 백준 10819
- 2096 파이썬
- 자바
- Jetpack Room
- 1003 파이썬
- 1753 다익스트라
- java
- 5582 DP
Archives
- Today
- Total
Gemstone's Devlog
[Coroutine] Atmoic Variables 본문
운영체제 공부할 때 race condition과 비슷한 내용인 것 같다.
여러 쓰레드가 공유된 변수를 동시에 접근해서 프로세스를 진행할 때 race condition이 발생하게 되는데
코틀린에서도 다음과 같이 공유 변수 counter를 AtomicInteger로 선언해두면 이를 방지할 수가 있다.
'Kotlin (Android)' 카테고리의 다른 글
[Android] MVP 디자인패턴 정리 (0) | 2022.07.13 |
---|---|
[Kotlin] Sealed Class, Generics Class 정리 (0) | 2022.07.02 |
[Coroutine Flow] Buffering (0) | 2022.06.30 |
Room 지속성 라이브러리 공부! (0) | 2022.06.28 |
[Coroutine Flow] 콜백 기반 api -> flow 변경 방법 (0) | 2022.06.24 |