Skip to content

Instantly share code, notes, and snippets.

@tamasd
Created February 25, 2014 16:36
Show Gist options
  • Save tamasd/9212541 to your computer and use it in GitHub Desktop.
Save tamasd/9212541 to your computer and use it in GitHub Desktop.
package main
import (
"runtime"
"sync"
)
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
var wg sync.WaitGroup
for i := 0; i < runtime.NumCPU(); i++ {
wg.Add(1)
go func() {
for {
}
}()
}
wg.Wait()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment