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 |
Tags
- 5582 DP
- 투포인터 알고리즘
- 자바
- android hilt
- 10819 파이썬
- 1806 백준
- 자료구조
- Android mvp
- java
- flow buffering
- 1753 다익스트라
- 백준 1644
- Coroutine Flow
- 1806 파이썬
- 1753 파이썬
- Android Room
- 6588 파이썬
- 백준 2096
- 이진 탐색
- 백준 10819
- 백준 5582
- 2096 파이썬
- 1806 투포인터
- 1003 파이썬
- 코루틴 플로우
- 안드로이드 hilt
- 1644 파이썬
- 5582 파이썬
- Jetpack Room
- git local remote
Archives
- Today
- Total
Gemstone's Devlog
Coroutine 정리 본문
왜 쓰레드를 안쓰고 코루틴을 사용할까?
쓰레드는 resource intesive하다.
그러나 코루틴은 lightweight 쓰레드이다. (쓰레드 풀에서 동작)
async 코드를 단순화하고, 콜백과 동기화가 되게 간편하다.
또한 문법도 단순하다. (simple syntax)
또 언제든 멈추고 재개할 수 있다.
# 코루틴 - basic concepts
Scope - create and run coroutines, provides lifecycle events
Context - the Scope provides a context in which the coroutine runs (state of coroutine)
Suspending functions - functions that can be run in a coroutine (can be suspended)
Job - a handle on a coroutine
Deferred - a future result of a coroutine
Dispatcher - manages which thread(s) the coroutine runs on
Error handling
'Kotlin (Android)' 카테고리의 다른 글
Paging 3.0 라이브러리 정리 (0) | 2022.06.14 |
---|---|
GDG Android I/O Extended Korea Android 2022 참가 후기 (0) | 2022.06.11 |
[의존성 주입] Hilt 정리 (0) | 2022.04.05 |
[코루틴 실습] 처음 만나는 코루틴 (0) | 2022.03.30 |
Coroutine 정리 (0) | 2022.03.28 |