Browse Source

Init GoMaxProcs op aantal cpu's voor go 1.4

Harry de Boer 10 years ago
parent
commit
021ccf61f3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      boardserver/main.go

+ 2 - 1
boardserver/main.go

@@ -4,10 +4,11 @@ import (
 	"log"
 	"net/http"
 	"pinguin/board"
+	"runtime"
 )
 
 func main() {
-	//runtime.GOMAXPROCS(1)
+	runtime.GOMAXPROCS(runtime.NumCPU())
 	http.HandleFunc("/api/board", boardHandler)
 	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
 		w.Write([]byte("Go battlecamp!"))