Skip to content

Commit 88c9f4a

Browse files
rwlock: Elaborate on benchmark
1 parent fe2a5fa commit 88c9f4a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

benchmarks/rwlock_cache.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
"""Simulation of a pool of workers reading a cached value which
22
occasionally must be replaced when it expires.
3+
4+
The workers coordinate so that only a single writer takes responsibility
5+
for updating the cached value when it expires. This minimizes contention
6+
and latency when the cache expires.
7+
8+
The simulation also attempts to detect if any workers read a stale value
9+
by rotating out read counters when the cache key is updated.
310
"""
411

512
import random

0 commit comments

Comments
 (0)