Skip to content

Instantly share code, notes, and snippets.

@KIDJourney
Created March 22, 2018 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KIDJourney/e7f54153ea039074d0c8ec841acafe8f to your computer and use it in GitHub Desktop.
Save KIDJourney/e7f54153ea039074d0c8ec841acafe8f to your computer and use it in GitHub Desktop.
package main
import (
"runtime"
"sync"
)
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
wg := sync.WaitGroup{}
for i := 0; i < runtime.NumCPU(); i ++ {
wg.Add(1)
go func() {
for {
}
wg.Done()
}()
}
wg.Wait()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment