-
-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We only need to be able to determine if a lease is active or there was any activity in the last timer period. That is now done 2 atomic counters - a count of leased leases and a count returned leases. The timer still has a potential race if a new lease occurs right after the timer checks it didn't occur and attempts to delete it. This was there even with the locks and this doesn't make any worse (AFAIK) Performance of single-threaded benchmark is unaffected, the 16 thread test sees 1.5-3x improvement (it is noisy :/) Counter (4 runs) | 1339ms...1971ms -> 881ms...939ms Histogram (4 runs) | 2021ms...2158ms -> 771ms...928ms The improvement is this small only because there is also a RWLock which not that trivial to remove (and no, .NET RWLock is not lockfree with purely read workload)
- Loading branch information
Showing
1 changed file
with
25 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters