package main import ( "log" "os/exec" "runtime" ) func runner(i int) { c := 0 for { c++ cmd := exec.Command("true") err := cmd.Run() if err != nil { log.Fatal(i, c, err) } if c%1000000 == 0 { log.Println("runner", i, c) } } } func main() { n := runtime.NumCPU() _ = runtime.GOMAXPROCS(n) log.Println("Found", n, "CPUs, spawning go routines") for i := 0; i < n; i++ { go runner(i) } select {} }