package main
import (
"runtime"
)
func task(){
a := 100
for {
a += 1
}
}
func main() {
runtime.GOMAXPROCS(1)
go task()
go task()
select {}
}
package main
import (
"runtime"
)
func task(){
a := 100
for {
a += 1
}
}
func main() {
runtime.GOMAXPROCS(1)
go task()
go task()
select {}
}
本文标题:golang 占满指定核CPU
本文链接:https://www.haomeiwen.com/subject/qmlnbrtx.html
网友评论