From Linux Threads To ForkJoinPool
summary
Explains how Linux CFS schedules by vruntime and how the kernel timer plus target latency 20ms produce tiny quanta when many threads exist, causing high context-switch overhead; shows that Java implements park/unpark on top of pthread primitives and that AbstractQueuedSynchronizer uses CAS plus spin-then-park for locks; demonstrates why classic single-queue thread pools suffer contention and why ForkJoinPool uses work-stealing deques, giving much better throughput for many tiny tasks.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:55Linux scheduler
- 8:56Scheduling policies
- 10:39CFS scheduler
- 14:36Multicore systems
- 17:52Thread communication
- 27:31Linux primitives
- 29:19Park and unpark
- 32:09Mutex implementation
- 35:41Java synchronization
- 36:03Thread pools
- 39:53Pool problems
- 41:58Work stealing
- 42:38ForkJoinPool
- 44:50Summary
- 46:42Q&A
related talks
04mInterview
37mEverything you wanted to know about threads but were afraid to ask
29mConcurrency and Parallelism From The Ground Up
54mHow threads help each other
01h 01mMultithreading vs Asynchronous Programming: The Architectural Shift
01h 18m“Work Stealing"
57mUnveiling the Magical Power of Java Virtual Threads
50mVirtual Threads, Structured Concurrency, Extent Locals: When to Use Them & How
