~/lightning

A Spinlock Implementation

Lightningat C++Now 2022 · 2022-05-01..05-06· [c-and-cpp]
slides:none on file

Microbenchmarks show an atomic increment hits ~200M ops/sec on one thread and falls to ~80M at 16 threads, while the custom spinlock sustains about ~167M across threads. Implementation uses an atomic exchange guarded by read-only probing to avoid costly exclusive cache line grabs, and a backoff that prefers nanosleep over sched_yield to let the unlocker run. Empirical tuning uses 8–12 spin iterations before yielding and a gradually increasing sleep time; the spinlock significantly improves throughput on tested hardware.

AI-written summary · about

~/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.