实现新的计数器算法(将时间分片, 统计更加精准)

This commit is contained in:
GoEdgeLab
2023-07-13 15:37:08 +08:00
parent 0a9e2a84c5
commit 428cf08e5b
13 changed files with 501 additions and 46 deletions

View File

@@ -50,3 +50,7 @@ func (this *RWMutex) TryLock(index int) bool {
func (this *RWMutex) TryRLock(index int) bool {
return this.lockers[index%this.countLockers].TryRLock()
}
func (this *RWMutex) RWMutex(index int) *sync.RWMutex {
return this.lockers[index%this.countLockers]
}