3 ms·
There's a number of fine points to distinguish. 1. in node there's only a single thread (ignoring workers) but in Go the thing you start can run in parallel wi
by karmakaze 4y ago
There's a number of fine points to distinguish.
1. in node there's only a single thread (ignoring workers) but in Go the thing you start can run in parallel with the other stuff.
2. even in Go it's two operations, if you want to wait for the goroutine, you have to use a WaitGroup or similar and wait on it.
3. in Go you can't turn off the goroutines. Every call to a library function can potentially suspend the goroutine and resume later transparently (other than elapsed time).
I'm fine with the way Go works as well as the explicit Future or CompletionStage of Java where I can actually control which threads things run on. We'll have to see what happens with project Loom to see how well that works. I haven't used Kotlin coroutines to comment.