Skip to content

Conversation

@neakor
Copy link
Contributor

@neakor neakor commented May 2, 2018

Instead of using a new DispatchQueue for each CountDownLatch, which is expensive, use NSCondition and AtomicInt. The AtomicInt allows concurrent countDown and await checks, to help reduce contention and locking cost on the NSCondition.

Instead of using a new `DispatchQueue` for each `CountDownLatch`, which is expensive, use `NSCondition` and `AtomicInt`. The `AtomicInt` allows concurrent `countDown` and `await` checks, to help reduce contention and locking cost on the `NSCondition`.
@neakor neakor requested a review from rudro May 2, 2018 19:03
@neakor neakor merged commit 2cc8fb2 into master May 2, 2018
@neakor neakor deleted the optimize-countdownlatch-master branch May 2, 2018 20:55
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

Successfully merging this pull request may close these issues.

3 participants