From 21f632368adbd3b3af71038ab697a6585a40db62 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Fri, 21 Aug 2020 14:08:49 +0800 Subject: [PATCH] Update comment --- ants.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ants.go b/ants.go index d00d190..2b4cde4 100644 --- a/ants.go +++ b/ants.go @@ -76,16 +76,15 @@ var ( // to get the best performance. Inspired by fasthttp at // https://github.com/valyala/fasthttp/blob/master/workerpool.go#L139 workerChanCap = func() int { - // Use blocking workerChan if GOMAXPROCS=1. - // This immediately switches Serve to WorkerFunc, which results - // in higher performance (under go1.5 at least). + // Use blocking channel if GOMAXPROCS=1. + // This switches context from sender to receiver immediately, + // which results in higher performance (under go1.5 at least). if runtime.GOMAXPROCS(0) == 1 { return 0 } // Use non-blocking workerChan if GOMAXPROCS>1, - // since otherwise the Serve caller (Acceptor) may lag accepting - // new connections if WorkerFunc is CPU-bound. + // since otherwise the sender might be dragged down if the receiver is CPU-bound. return 1 }()