~/talk

Reader-Writer Lock versus Mutex - Understanding a Lost Bet

Talkat CppCon 2017 · 2017-09-24..09-29· [concurrency]
links:none on file
slides:none on file

A controlled Linux benchmark simulates back-to-back access to a shared map (load ≈300 math ops) and compares do-nothing, a single atomic operation, pthread reader-writer, a lightweight losing implementation and a novel winning implementation that combines a mutex, a semaphore and fast reacquire logic. The surprising result: the initial rwlock loses to a mutex for 90% reads with short lock-hold times, but the winning implementation beats the mutex in 10 scenarios, ties in 8, and only loses in 2; Sun and macOS show platform-specific outliers.

AI-written summary · about

  1. 0:00Intro
  2. 0:13DEFINITIONS
  3. 10:12MANAGING EXPECTATIONS
  4. 12:03COST OF ONE ATOMIC
  5. 20:26COST OF MUTEX AND SEMAPHORE
  6. 21:44DESIGN CRITERIA
  7. 23:06LOSING IMPLEMENTATION
  8. 34:15WINNING IMPLEMENTATION
  9. 39:11LINUX RECAP
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.