I just got into a heated discussion with someone w...
# coroutines
w
I just got into a heated discussion with someone who claimed kotlin coroutines are nothing like project loom virtual threads because they don't copy the call stack. I suspect he is wrong, because coroutines seem to behave just like loom virtual threads to me, but I don't know enough. Can someone enlighten me?
d
iirc Loom is stackful and coroutines is stackless.
A coroutine is a state machine and a Fibre (?) is a user space thread.
w
Fiber is now "Virtual Threads" officially now I think. But OK, so what does that mean? There are some things you can do in vt that you can't in coroutines? Like deal with locks maybe?
d
Roman Elizarov has a stackoverflow post about this somewhere
Though he talks about goroutines which are basically the same thing as virtual threads
w
Thanks, this helps
And gives me some of the right terms to google for more :)
z
I think it also has debugging implications. Coroutines are famous for giving useless stack traces, because they don’t capture any information about the stack by default.
w
Ah good point