]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: default GOMAXPROCS to NumCPU(), not 1
authorRuss Cox <rsc@golang.org>
Thu, 28 May 2015 16:35:35 +0000 (12:35 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 5 Jun 2015 04:38:04 +0000 (04:38 +0000)
See golang.org/s/go15gomaxprocs for details.

Change-Id: I8de5df34fa01d31d78f0194ec78a2474c281243c
Reviewed-on: https://go-review.googlesource.com/10668
Reviewed-by: Rob Pike <r@golang.org>
src/runtime/proc1.go

index ba092c7f8824ae62a954f7417dfac3fcf5244403..0f93ff7620b502214c6090ed54aa81d9ed4ab7ef 100644 (file)
@@ -62,7 +62,7 @@ func schedinit() {
        gcinit()
 
        sched.lastpoll = uint64(nanotime())
-       procs := 1
+       procs := int(ncpu)
        if n := atoi(gogetenv("GOMAXPROCS")); n > 0 {
                if n > _MaxGomaxprocs {
                        n = _MaxGomaxprocs