Go is a M:N scheduler with M kernel threads and N lightweight threads
I wrote a 1:M:N lightweight scheduler which preempts hot loops. I don't know when Golang preempt goroutines outside of a channel send - I believe it's in stack growth or in other words when a method is called.
My userspace scheduler preempts while true and for loops by setting the looping variable to the limit.
I wrote it in Java, C and Rust.
https://GitHub.com/samsquire/preemptible-thread
Does anybody know if Nim loop variables can be easily mutated from another thread?
It looks they cannot