Threads and Coroutinesfrom the CommonsWare Community archives
At November 10, 2021, 3:56pm, ten asked:
I want to know
Why Coroutines are better than Threads
If I launch 1 lakh Coroutines , these internally choose 1 lakh worker threads right. So where Coroutines are different from Threads
Coroutines use “Concurrency Design Pattern” ,
What is Concurrency Design Pattern.
Thank you in advance
At November 10, 2021, 4:13pm, mmurphy replied:
I cannot really answer that. That is akin to asking “why green is better than a triangle”. Coroutines, like RxJava, are a layer atop of threads.
Sorry, but I am not completely certain what “lakh” means here (100,000 perhaps?). Coroutines do not map 1:1 to worker threads. See the chapter on dispatchers in Elements of Kotlin Coroutines, a book available as part of your Warescription.
I do not know exactly what you are referring to with that specific quoted phrase, sorry.
At November 17, 2021, 5:05pm, ten replied:
I want to start learning “RxJava”.
Could u suggest some resources for learning from the basics.
Thanks in advance
At November 17, 2021, 6:36pm, mmurphy replied:
Otherwise, I have not looked for RxJava resources in a few years, so I do not have any particular links handy — sorry!