Skip to content
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: document that the rate limiter is safe for concurrent usage #17261

Open
nightlyone opened this issue Sep 28, 2016 · 3 comments
Open

x/time/rate: document that the rate limiter is safe for concurrent usage #17261

nightlyone opened this issue Sep 28, 2016 · 3 comments
Labels
Documentation NeedsFix Suggested
Milestone

Comments

@nightlyone
Copy link
Contributor

@nightlyone nightlyone commented Sep 28, 2016

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.7.1 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ingo/sources/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build059178747=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

What did you do?

Read documentation of https://godoc.org/golang.org/x/time/rate

What did you expect to see?

Mention that all types (or at least which types, functions, methods) are safe for concurrent usage and don't need extra locking around them.

What did you see instead?

Nothing. But I concluded that by reading the code.

@nightlyone
Copy link
Contributor Author

@nightlyone nightlyone commented Sep 28, 2016

I only filed that issue, because I wanted to refer a colleague to the docs saying that this needs no extra locks, but found that the docs don't mention it and Go documentation style default is "you need locking until stuff is marked as concurrency safe".

@bradfitz bradfitz added this to the Unreleased milestone Sep 28, 2016
@ALTree ALTree added Suggested NeedsFix labels Jul 15, 2019
@zengchu2
Copy link

@zengchu2 zengchu2 commented Jul 5, 2022

Can I work on this issue ?
I would like to implement a couple test cases for functions like Limit(), SetLimit() ... for type Limiter. Currently there is only one test case for method Allow() that uses multi goroutines. @ALTree @bradfitz

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jul 5, 2022

@zengchu2 Go ahead. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation NeedsFix Suggested
Projects
None yet
Development

No branches or pull requests

5 participants