https://kotlinlang.org logo
Title
a

Adi Polak

04/17/2019, 12:57 PM
Kotlin coroutines, are they better than threads when developing server side ? are they a better than Java thread pool ?
r

ribesg

04/17/2019, 1:02 PM
Threads and coroutines are different things, it’s not really a A vs B situation
a

Adi Polak

04/17/2019, 2:18 PM
Thank you!
s

Stephan Schroeder

04/17/2019, 3:17 PM
s

sahil Lone

04/24/2019, 6:15 PM
@adi It really depends what u want to achieve, if you look at just thread pools , they are by themselves unusable in a larger scope, the key lies in how the scheduling is done when u hit a blocking part of code, this is where coroutines shine upto a particular level. Threads are only a problem when u start using blocking code like jdbc calls. This is where coroutines can help u limit the no of threads
You can also look at Vertx framework, its pretty good at helping to control blocking calls