Установлена переменная GOMAXPROCS
This commit is contained in:
6
main.go
6
main.go
@@ -30,6 +30,12 @@ func lstn(connection *net.UDPConn, alarm chan struct{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
envFlag := runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
|
if envFlag > -1 {
|
||||||
|
fmt.Println("GOMAXPROCS =", runtime.NumCPU())
|
||||||
|
} else {
|
||||||
|
fmt.Println("GOMAXPROCS is default!")
|
||||||
|
}
|
||||||
argIP := flag.String("ip", "0.0.0.0", "Listen IP address")
|
argIP := flag.String("ip", "0.0.0.0", "Listen IP address")
|
||||||
argPort := flag.Int("port", 10003, "Listen Port number")
|
argPort := flag.Int("port", 10003, "Listen Port number")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|||||||
Reference in New Issue
Block a user