DEV Community

loading...

Discussion on: You don't need a library for state machines

Collapse
nbilyk profile image
Nicholas Bilyk

<3 Kotlin

Collapse
darkwiiplayer profile image
DarkWiiPlayer

I've had a quick look at kotlin "coroutines" and they seem more like light threads to me than actual coroutines.

Thread Thread
nbilyk profile image
Nicholas Bilyk

Coroutines in Kotlin use threading strategies, so for example you can have a common pool for greenthreading, you can have a main thread for UI, a dedicated thread for IO, or no threading for environments like web that don't support it. Threads are a part of it, but kotlin coroutines at their core is really just a way to do parallel work without callbacks.

Thread Thread
darkwiiplayer profile image
DarkWiiPlayer

That's... not what coroutines are though...

Thread Thread
nbilyk profile image
Nicholas Bilyk

Ok, get into that debate with them then.

Thread Thread
darkwiiplayer profile image
DarkWiiPlayer

It's not really a debate. If they want to call their green threads coroutines, that's their choice. I just find it confusing, because I'm used to coroutines being actual coroutines.