His comment regarding preemptive vs cooperative scheduling, so which is it? Does Go have preemptive scheduling or not? I was under the impression that it did get that somewhat recently? Could anyone point me in the right direction?
package main
import (
"fmt"
"runtime"
)
func infiniteLoop() {
for {}
fmt.Println("world")
}
func main() {
runtime.GOMAXPROCS(1)
go infiniteLoop()
fmt.Println("hello")
}
For more information, see Go's source code which is exceptionally well commented:
https://go.dev/src/runtime/preempt.go