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

TokenBucket - thread lock is too broad #4

Open
Liwoj opened this issue Apr 21, 2016 · 0 comments
Open

TokenBucket - thread lock is too broad #4

Liwoj opened this issue Apr 21, 2016 · 0 comments

Comments

@Liwoj
Copy link

Liwoj commented Apr 21, 2016

Hey

I'v found your port of TokenBucket algorithm interesting (even that in the end i'v used another\simpler implementation).

Just one thing i'v noticed. Locks in the TokenBucket base class are too broad because "locker object" is defined as static while protecting instance (not static) state. If more instances will be used in the single app, they would be racing for that single lock for no reason.

HTH

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

No branches or pull requests

1 participant