Concurrency

Concurrency

Virtual threads, async/await, work-stealing, lock contention, memory models.

65Articles
65Topics covered
Articles in this category

All 22 articles, sorted alphabetically

Advertisement
ARTICLE · 01

Reactive Streams Backpressure Architecture

How reactive streams (Project Reactor, RxJava) propagate demand upstream.

Read article
ARTICLE · 02

Actor Model Architecture in Depth

A 2500-word walkthrough of the actor model: actors, mailboxes, dispatchers, supervisors, cluster distribution, and event-sourced persistence.

Read article
ARTICLE · 03

Thread barrier architecture

Deep-dive on thread barriers: the party count and arrival protocol, the last-arriver that trips the barrier, the run-once barrier action, the generati…

Read article
ARTICLE · 04

Coroutines -- cooperative suspension for concurrency

Deep-dive on coroutines: functions that suspend at await/yield points, cooperative scheduling, the event loop, cheap massive IO-bound concurrency vs t…

Read article
ARTICLE · 05

Deadlock detection and prevention architecture - Coffman conditions, lock ordering, recovery

Deep-dive on deadlock: the four Coffman conditions and the wait-for graph, prevention via lock ordering, avoidance with the Banker&amp…

Read article
ARTICLE · 06

False sharing architecture

Deep-dive on false sharing: how a 64-byte cache line and the MESI coherence protocol turn independent per-thread writes into an invalidation storm, wh…

Read article
ARTICLE · 07

Futures and promises architecture

Deep-dive on futures and promises: the shared write-once state cell, promise as the write end and future as the read end, the callback-registration ra…

Read article
ARTICLE · 08

Hazard pointers architecture

Deep-dive on hazard pointers, the safe-memory-reclamation scheme that lets lock-free stacks, queues, and maps free deleted nodes without use-after-fre…

Read article
ARTICLE · 09

Lock-Free Data Structures Architecture in Depth

A 2500-word walkthrough of lock-free data structures: CAS loops, memory order, ABA problem, hazard pointers, epoch GC, wait-free vs lock-free.

Read article
ARTICLE · 10

Java Memory Model architecture

Deep-dive on the JMM as a system: compiler and CPU reordering, store buffers vs cache coherence, happens-before edges from volatile, monitors, final f…

Read article
ARTICLE · 11

Priority inversion architecture

Deep-dive on priority inversion: the three-thread scenario that rebooted Mars Pathfinder, bounded vs unbounded inversion, priority inheritance and cei…

Read article
ARTICLE · 12

Read-Copy-Update (RCU) architecture

Deep-dive on RCU: near-free lock-free reads via rcu_read_lock and rcu_dereference, the writer's copy-swap-publish protocol wi…

Read article
ARTICLE · 13

Read-write lock architecture

Deep-dive on read-write (shared-exclusive) locks: reader-count/writer-flag internals, readers- vs writer-preference fairness and starvation, the upgra…

Read article
ARTICLE · 14

Thread Scheduler Architecture in Depth

A 2500-word walkthrough of thread scheduler: CFS/EEVDF, priority + niceness, work stealing, preemption, real-time, cgroups, NUMA, affinity.

Read article
ARTICLE · 15

Semaphore architecture

Deep-dive on counting semaphores: the atomic permit count and wait queue, acquire/release on a queued synchronizer, fair vs non-fair (barging) acquisi…

Read article
ARTICLE · 16

Seqlock architecture

Deep-dive on the seqlock: the even/odd sequence counter, optimistic reader retry, the exact acquire/release memory ordering that makes it correct, wri…

Read article
ARTICLE · 17

Spinlock architecture

Deep-dive on spinlocks: the spin-versus-sleep decision governed by hold time and core count, compare-and-swap with acquire/release barriers, cache-lin…

Read article
ARTICLE · 18

Structured concurrency architecture

Deep-dive on structured concurrency: scope lifecycles and the join guarantee, fail-fast vs first-success vs collect-all policies, cooperative cancella…

Read article
ARTICLE · 19

Thread pools -- reuse threads instead of creating them

Deep-dive on thread pools: the thread-per-task cost problem, reusable worker threads, the task queue, bounded concurrency, pool sizing (CPU-bound vs I…

Read article
ARTICLE · 20

Work-stealing schedulers

Deep-dive on work-stealing schedulers: per-thread deques, LIFO-local/FIFO-steal mechanics, fork-join pairing and locality, low contention, blocking ha…

Read article
ARTICLE · 21

ThreadLocal vs ScopedValue Architecture

How to carry request-scoped data across threads, and why ScopedValue is better in the virtual-threads era.

Read article
ARTICLE · 22

Work-Stealing Scheduler Architecture

The scheduler pattern behind Fork/Join, Go's runtime, and Rust's Tokio.

Read article