Chore: use automaxprocs

This commit is contained in:
xjasonlyu
2022-01-28 15:01:04 +08:00
parent 2a2420f89d
commit 1bbb51b332
5 changed files with 25 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ const (
var (
_tcpQueue = make(chan core.TCPConn) /* unbuffered */
_udpQueue = make(chan core.UDPPacket, maxUDPQueueSize)
_numUDPWorkers = max(runtime.NumCPU(), 4 /* at least 4 workers */)
_numUDPWorkers = max(runtime.GOMAXPROCS(0), 4 /* at least 4 workers */)
)
func init() {