Исходники и презентации
This commit is contained in:
16
lessons/goroutines_and_scheduler/gmp_model/main.go
Normal file
16
lessons/goroutines_and_scheduler/gmp_model/main.go
Normal file
@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("GOMAXPROCS:", runtime.GOMAXPROCS(0))
|
||||
fmt.Println("CPU:", runtime.NumCPU())
|
||||
|
||||
runtime.GOMAXPROCS(16)
|
||||
|
||||
fmt.Println("GOMAXPROCS:", runtime.GOMAXPROCS(0))
|
||||
fmt.Println("CPU:", runtime.NumCPU())
|
||||
}
|
||||
Reference in New Issue
Block a user