Concurrency

Concurrency

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

65Articles
65Topics covered
Articles in this category

All 65 articles, sorted alphabetically

Advertisement
ARTICLE · 01

The Virtual Thread Model: M:N Mapping in Java

The Virtual Thread Model: M:N Mapping in Java

Read article
ARTICLE · 02

Blocking & Unmounting: The Magic of Virtual Threads

Blocking & Unmounting: The Magic of Virtual Threads

Read article
ARTICLE · 03

Throughput vs. Latency - AICassindra

Throughput vs. Latency - AICassindra

Read article
ARTICLE · 04

Structured Concurrency: Taming the Threads

Structured Concurrency: Taming the Threads

Read article
ARTICLE · 05

Pinning Pitfalls: When Virtual Threads Get Stuck

Pinning Pitfalls: When Virtual Threads Get Stuck

Read article
ARTICLE · 06

Actor Model Architecture

How actors + message passing avoid shared state and enable location transparency.

Read article
ARTICLE · 07

Actor Pattern Explained

Erlang to Akka the abstraction that makes concurrency safe.

Read article
ARTICLE · 08

Async/Await Patterns

Beyond the basic example.

Read article
ARTICLE · 09

Coroutines vs Threads Architecture (Kotlin / Go / Rust)

How coroutine-based runtimes compare to Java virtual threads.

Read article
ARTICLE · 10

Java Executor Framework Architecture

How Executor + ThreadPoolExecutor decouple task submission from execution, with the queue mechanics.

Read article
ARTICLE · 11

Fork/Join Pool Architecture

The specialized executor behind parallel streams and RecursiveTask.

Read article
ARTICLE · 12

Goroutines at Scale

What breaks at 100K and what to do about it.

Read article
ARTICLE · 13

Green Threads

Goroutines Erlang virtual threads converging.

Read article
ARTICLE · 14

Java Memory Model Explained

happens-before volatile and why your unsynchronized code is wrong.

Read article
ARTICLE · 15

Java Virtual Threads in Production

Project Loom what changes and what stays the same.

Read article
ARTICLE · 16

Java Virtual Threads Pitfalls

Project Loom is great. Watch these footguns.

Read article
ARTICLE · 17

Lock Contention Diagnosis

Tools and patterns for finding the bottleneck.

Read article
ARTICLE · 18

Lock-Free Data Structures Architecture

Compare-and-swap based concurrent structures, with the ABA problem + retry loop pattern.

Read article
ARTICLE · 19

Lock-Free Data Structures

Compare-and-swap atomic ops and the ABA problem.

Read article
ARTICLE · 20

Memory Model Basics

Happens-before visibility and reordering.

Read article
ARTICLE · 21

Producer/Consumer Architecture with BlockingQueue

The canonical async decoupling pattern with the memory + backpressure model.

Read article
ARTICLE · 22

Reactive Streams Backpressure Architecture

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

Read article
ARTICLE · 23

Rust Async Runtime Picture

Tokio async-std smol — when each fits.

Read article
ARTICLE · 24

Actor Model

How the actor model avoids race conditions by encapsulating state in independent actors that communicate via messages.

Read article
ARTICLE · 25

Atomic Operations

How atomic operations (CAS, atomic increment) enable lock-free concurrent updates and are the foundation of lock-free data structures.

Read article
ARTICLE · 26

Coroutines

How coroutines enable concurrent code with much lower overhead than OS threads, and how they're used in Python asyncio, Kotlin, G…

Read article
ARTICLE · 27

Deadlock

The four conditions for deadlock, common patterns, and how to prevent them.

Read article
ARTICLE · 28

Futures and Promises

How futures represent values that will exist later, and promises are the writable side that completes them.

Read article
ARTICLE · 29

Thread Lifecycle

The states a thread passes through and the transitions between them.

Read article
ARTICLE · 30

Locks and Mutexes

How locks work, spin vs sleep, and how to avoid the classic mistakes.

Read article
ARTICLE · 31

Thread Pools

How thread pools amortize thread creation cost by reusing threads across many tasks.

Read article
ARTICLE · 32

Race Conditions

How race conditions arise from unsynchronized shared-state access, and how to fix them.

Read article
ARTICLE · 33

Thread Synchronization

The synchronization primitives (locks, semaphores, barriers) that coordinate threads accessing shared data.

Read article
ARTICLE · 34

Actor model architecture

Deep-dive on the actor model: actors, mailboxes, dispatchers, supervision, backpressure, location transparency, persistence.

Read article
ARTICLE · 35

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 · 36

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 · 37

Channels Architecture in Depth

A 2500-word walkthrough of channels: producer/consumer, typed FIFO, buffered vs unbuffered, close semantics, select, backpressure, deadlock.

Read article
ARTICLE · 38

Condition variable architecture

Deep-dive on condition variables: mutex, predicate, wait/notify, spurious wakeups, wait loop, timed wait, lost wakeup.

Read article
ARTICLE · 39

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 · 40

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 · 41

LMAX Disruptor architecture

Deep-dive on LMAX Disruptor: ring buffer, sequences, wait strategies, cache-line padding, barrier, batch processing, configurations.

Read article
ARTICLE · 42

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 · 43

ForkJoinPool architecture

Deep-dive on Java ForkJoinPool: RecursiveTask, worker deques, work stealing, common pool, ManagedBlocker, parallelism, streams.

Read article
ARTICLE · 44

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 · 45

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 · 46

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 · 47

Lock-free architecture

Deep-dive on lock-free algorithms: CAS, memory ordering, progress guarantees, ABA, hazard pointers, RCU, MPMC queues, cache-line effects.

Read article
ARTICLE · 48

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 · 49

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 · 50

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 · 51

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 · 52

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 · 53

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 · 54

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 · 55

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 · 56

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 · 57

ThreadLocal architecture

Deep-dive on Java ThreadLocal: per-thread storage, lifecycle, weak references, leaks in pools, InheritableThreadLocal, ScopedValue.

Read article
ARTICLE · 58

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 · 59

JVM virtual threads architecture

Deep-dive on JVM Loom virtual threads: continuations, carriers, park/unpark, pinning, structured concurrency, and scoped values.

Read article
ARTICLE · 60

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 · 61

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 · 62

Virtual Threads vs Platform Threads

How virtual threads free the JVM from OS-thread constraints, with the underlying mount/unmount mechanics.

Read article
ARTICLE · 63

Work Stealing Explained

Fork/join Tokio scheduler and the algorithm.

Read article
ARTICLE · 64

Work-Stealing Scheduler Architecture

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

Read article