|
|
|
|
|
by nromiun
326 days ago
|
|
Both basically. Another beauty of M:N green threads is that you don't need to differentiate between IO and CPU bound tasks. If you add all those rules to coroutines you are halfway to preemptive scheduling already. And maybe async is not the answer if it still needs more work and tooling after all these years. |
|
Go must do all sorts of trickery with the preemption. Like inserting yield points or even depend on signals so it can preempt a goroutine which didn't hit a yield point. It basically replicates what the OS does with threads.