Add lru-cache module: LinkedHashMap and hand-rolled DLL LRU, coarse-lock/striped thread-safe variants, broken ReadWriteLock demo, Caffeine reference, 43 tests, JMH harness

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b4VQVEJWetTT1dYzyJ
This commit is contained in:
2026-10-29 05:52:27 +00:00
co-authored by Claude Sonnet 5.5
parent 4a376b94e9
commit 0457cf4bfb
31 changed files with 1425 additions and 0 deletions
@@ -0,0 +1,18 @@
cores=2 threads=4 opsPerThread=400000 capacity=64 keys=128
workload: 90% get, 10% put, uniform random keys
round 1
ReadWriteLock, get under READ lock worker exceptions=0; size=64/64; INVARIANT BROKEN: list length 17 != index size 64
synchronized (correct) worker exceptions=0; size=64/64; invariants OK
round 2
ReadWriteLock, get under READ lock worker exceptions=0; size=64/64; INVARIANT BROKEN: list node not in index: 94
synchronized (correct) worker exceptions=0; size=64/64; invariants OK
round 3
ReadWriteLock, get under READ lock worker exceptions=0; size=64/64; invariants OK
synchronized (correct) worker exceptions=0; size=64/64; invariants OK
round 4
ReadWriteLock, get under READ lock worker exceptions=0; size=64/64; INVARIANT BROKEN: list node not in index: 125
synchronized (correct) worker exceptions=0; size=64/64; invariants OK
round 5
ReadWriteLock, get under READ lock worker exceptions=0; size=64/64; invariants OK
synchronized (correct) worker exceptions=0; size=64/64; invariants OK