add comment to explain mysterious policy in concurrentWrapper
This commit is contained in:
parent
9b0ee8e856
commit
c2cb334506
1 changed files with 4 additions and 0 deletions
|
@ -72,6 +72,10 @@ static void* cwGetStaleHelper(struct replacementPolicy* impl, void*(*func)(struc
|
|||
}
|
||||
}
|
||||
if(bucket != oldbucket) {
|
||||
// note that, even on success, we increment the bucket. Otherwise, we could
|
||||
// (would) eventually get unlucky, and some caller would do a getStaleAndRemove,
|
||||
// fail to get a latch, insert it back, and the next getStaleAndRemove would
|
||||
// deterministically return the same page again, leading to an infinite loop.
|
||||
pthread_setspecific(rp->next_bucket, (void*) bucket);
|
||||
}
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue