4 ms·
here is the talk by Roman Elizarov, the Kotlin project lead, at KotlinConf 2023 about Coroutines vs VThreads: https://www.youtube.com/watch?v=zluKcazgkV4 https:
by simon_void 3y ago
here is the talk by Roman Elizarov, the Kotlin project lead, at KotlinConf 2023 about Coroutines vs VThreads: https://www.youtube.com/watch?v=zluKcazgkV4 https://www.youtube.com/watch?v=zluKcazgkV4
short version: both were optimized for different things, so there is a place for both of them.
- MrBuddyCasino 3y agoDidn’t find it too convincing. He says Coroutines are for fine-granular concurrency, and Virtual Threads for coarse thread-per-request apps. In my experience fine granular concurrency is rare, and thread-per-request is 99% of the work. This might be different for Android development, but its true for server side code. The cost you pay for this gain in fine grained control (which you rarely need) is unfortunately the colored function problem, and in my experience it is rather annoying. Also the complexity of having a second unit-of-computation abstraction besides threads, and Coroutines aren’t a small API surface (goes along with Flows). tl;dr: the inferior developer experience (added complexity, colored functions) must be offset by a gain in usefulness, and I just don’t see it
- yawboakye 3y agoone of the (main) benefits of coroutines is the luxury of offloading thread management and semantics to a lower layer so that we can deal in functions/methods (aka units of execution) as units of concurrency. obviously that comes at a cost, like any general purpose convenience.
- wiseowise 3y agoFunction color is a feature: https://elizarov.medium.com/how-do-you-color-your-functions-a6bb423d936d https://elizarov.medium.com/how-do-you-color-your-functions-...