Go scheduler and CGO: Please explain this difference of behavior?
问题 I'd like to know the implementation reason for this: package main func main() { c := make(chan struct{}) go func() { print("a") for { } }() go func() { print("b") for { } }() go func() { print("c") c <- struct{}{} for { } }() <-c } ❯❯❯ GOMAXPROCS=2 go run sample1.go ab <--- blocks. package main // static void loop() { for(;;); } import "C" func main() { c := make(chan struct{}) go func() { print("a") C.loop() print("x") }() go func() { print("b") C.loop() print("y") }() go func() { print("c")