Skip to content

Commit 8bfee3d

Browse files
authored
Volatile read LFU drain status (#512)
1 parent fcfd183 commit 8bfee3d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

BitFaster.Caching/Lfu/ConcurrentLfu.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ IEnumerator IEnumerable.GetEnumerator()
514514

515515
private void TryScheduleDrain()
516516
{
517-
if (this.drainStatus.NonVolatileRead() >= DrainStatus.ProcessingToIdle)
517+
if (this.drainStatus.VolatileRead() >= DrainStatus.ProcessingToIdle)
518518
{
519519
return;
520520
}
@@ -832,8 +832,6 @@ private bool AdmitCandidate(K candidateKey, K victimKey)
832832
int victimFreq = this.cmSketch.EstimateFrequency(victimKey);
833833
int candidateFreq = this.cmSketch.EstimateFrequency(candidateKey);
834834

835-
//var (victimFreq, candidateFreq) = this.cmSketch.EstimateFrequency(victimKey, candidateKey);
836-
837835
// TODO: random factor when candidate freq < 5
838836
return candidateFreq > victimFreq;
839837
}

0 commit comments

Comments
 (0)