~/talk

Gentle Intro. to Lock-Free Programming in Java

Talkat JNation 2025 · 2025-05-27..05-28· [java, concurrency]
links:none on file
slides:none on file

Explains concrete lock-free techniques: using a CAS loop to retry updates, implementing a Michael–Scott queue where enqueue uses two CAS steps (leading to tail lagging and a “helping” fix), and using AtomicMarkableReference or version tags to avoid ABA. Shows microbenchmarks where atomics reach several× the throughput of synchronized counters, discusses GC easing reclamation in Java vs manual free in C/C++, and uses JCStress to stress-test correctness under interleavings.

AI-written summary · about

  1. 0:00Introduction and welcome
  2. 3:12What is lock-free programming
  3. 7:30Thread safety and atomic operations
  4. 12:49Atomic primitives and hardware
  5. 15:59Benchmarking atomic vs locks
  6. 17:45Compare-and-swap loops
  7. 19:10Michael Scott lock-free queue
  8. 25:55Testing with JCStress
  9. 29:09ABA problem explained
  10. 33:00Non-blocking lists and ABA fixes
  11. 36:58Java Memory Model with atomics
  12. 38:48When to use lock-free
  13. 41:00Problems with atomics
  14. 43:04Summary and recommendations
  15. 46:56Q&A and closing
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.