July 2018
Intermediate to advanced
400 pages
12h 14m
English
Notice the
icon in Android Studio next to where you called the await function.
The IDE indicates that you made a suspend function call on that line.
What does this mean?
Coroutines are said to “suspend,” whereas a traditional thread is said to “block.” This difference in terminology hints at why coroutines offer better performance than threads: When a thread is blocked, it can no longer be used to do any work until it is unblocked. A coroutine is executed by a thread – for example, the Android UI thread, or a thread in the common pool – but does not block the thread that executes it. Instead, a thread executing ...
Read now
Unlock full access