We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe2a5fa commit 88c9f4aCopy full SHA for 88c9f4a
benchmarks/rwlock_cache.py
@@ -1,5 +1,12 @@
1
"""Simulation of a pool of workers reading a cached value which
2
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.
10
"""
11
12
import random
0 commit comments