-
Notifications
You must be signed in to change notification settings - Fork 17.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/time/rate: question or bug report about Limiter.advance #23145
Comments
What is error access number? |
import : i set ctx timeout to 3s. all goroutine can be done without any doubt. so after 3s, there should have 1000 + 10000 + 40 - 40 - 3 * 1000 = 8000 but result is 7000+ |
The program posted above assumes too many things, it contains data races. Don't append to the |
i do assume something, but i cannot write a more strain forward one. i think all task is done in 1s. and |
Because of limited clock resolution, at high rates, the actual rate may be up to 1% different from the specified rate. i find this in other realize document. but i still think
is wired. since you callback clock. |
What version of Go are you using (
go version
)?go version go1.9.2 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/xiaolin.zhang/gopath"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wd/vt73dmmj5y38hft8kg5l1wgm0000gq/T/go-build260497711=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
i create a
limit=rate.NewLimiter(400, 400)
, run 810goroutine call wait
at the sametime,error access number should >= 10. however, less then 10.
After read source code
The text was updated successfully, but these errors were encountered: