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

Implement java.util.concurrent.Semaphore and use it in IOThrottler #4102

Open
gzm0 opened this issue Jun 26, 2020 · 4 comments
Open

Implement java.util.concurrent.Semaphore and use it in IOThrottler #4102

gzm0 opened this issue Jun 26, 2020 · 4 comments

Comments

@gzm0
Copy link
Contributor

@gzm0 gzm0 commented Jun 26, 2020

This is a follow-up to #4097 where we used an AtomicInteger as a poor-mans replacement for a Semaphore with tryAcquire (or maybe even drainPermits).

@hepin1989
Copy link

@hepin1989 hepin1989 commented Oct 21, 2020

Better implement AQS first?

@gzm0
Copy link
Contributor Author

@gzm0 gzm0 commented Oct 21, 2020

What's AQS?

@hepin1989
Copy link

@hepin1989 hepin1989 commented Oct 21, 2020

@gzm0 AbstractQueuedSynchronizer

@sjrd
Copy link
Member

@sjrd sjrd commented Oct 21, 2020

And why would we need this AbstractQueuedSynchronizer before implementing Semaphore? Semaphore's API doesn't mention that class, so there is no dependency.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.