The following code as is in https://play.golang.org/p/X1-jZ2JcbOQ
package main
import (
"fmt"
)
func p(s string) {
fmt.Println(s)
}
func main() {
go fmt.Println("1")
go p("2")
for {} // infinite loop
}
prints 1 2 definitely in Windows with golang 1.11 but prints nothing definitely in Linux with golang 1.11.4. I can understand the former behavior but not the latter. Why is the go program not running non-master thread all the time?
Is there a reason behind this?