I'm wondering , how does the Kotlin co-routines ac...
# announcements
a
I'm wondering , how does the Kotlin co-routines actually work on an android device? I know it doesnt use threads , so what does it use? there's an example with 100 thousand co-routines being run simultaneously which is pretty cool , compared to the old threads
m
adibfara: it’s impossible to avoid using threads in Java 🙂. coroutines just does not spawn new ones.
a
like a thread pool?
m
AFAIK, it depends on library’s choice and it’s possible to use Java’s threadPoolExecutors, Android’s handlerThreads, and whatever.
e
You can run 100k coroutines in the same thread. When one coroutine suspends, the thread is available for other coroutines. You can join #coroutines for further discussion
k
Coroutines are special functions which can be suspended during execution. "Suspended" means they stop working and dump their state somewhere. Later, you can restore their state and continue execution.
a
Thanks everyone , #coroutines seem a good place for this kind of discussion