Cover of Concurrency in Practice
DRM-free · Yours for good
Backend Engineering

Concurrency in Practice

Threads, async and lock-free patterns for services under real load

By Omar El Alaoui

PDF318 pagesAdvancedEnglish

One-time purchase

€9.95

VAT included
where applicable

Ask a question
  • Download starts the moment you pay
  • Reads anywhere a PDF does
  • Edition updates come free
  • Checkout handled securely

About the book

What you’re getting into

Concurrency is where confident code goes to embarrass itself. This book takes you past the textbook mutex into the patterns that keep high-throughput services both fast and correct — async runtimes, work queues, backpressure, and the race conditions that only ever show up in production. It's language-agnostic and relentlessly practical about how concurrent systems really behave once the load is real.

After you’ve read it

What you’ll be able to do

  • Reason about shared state, ordering and visibility
  • Pick between threads, async runtimes and message passing
  • Guard shared data without turning locks into bottlenecks
  • Apply lock-free patterns where they genuinely pay off
  • Design backpressure so overload degrades instead of collapsing
  • Parallelise work for throughput with sensible pool sizing
  • Reproduce, diagnose and fix races and deadlocks
  • Shut services down cleanly under active traffic

Table of contents

9 ch · 27 parts
  1. 01

    Why Concurrency Bites

    • Shared state and the illusion of order
    • Latency versus throughput
    • A mental model for the book
  2. 02

    Threads, Tasks and Runtimes

    • OS threads versus green threads
    • Event loops and async/await
    • Choosing a model for the job
  3. 03

    Sharing State Safely

    • Mutexes and their hidden costs
    • Read-write locks and their traps
    • When not to share at all
  4. 04

    Lock-Free and Wait-Free Patterns

    • Atomics and compare-and-swap
    • Lock-free queues and ring buffers
    • When lock-free isn't worth it
  5. 05

    Message Passing and Actors

    • Channels and mailboxes
    • Actor supervision and isolation
    • Avoiding accidental shared state
  6. 06

    Backpressure and Flow Control

    • Bounded queues as a design tool
    • Rate limiting incoming work
    • Dropping versus blocking
  7. 07

    Parallelism for Throughput

    • Work stealing and scheduling
    • Fan-out and fan-in patterns
    • Sizing pools to the hardware
  8. 08

    Debugging Races and Deadlocks

    • Reproducing the unreproducible
    • Detecting deadlocks and livelocks
    • Stress and property-based testing
  9. 09

    Concurrency in Production

    • Observability for concurrent code
    • Graceful shutdown and draining
    • A reliability checklist

The full chapter list, exactly as it appears in your PDF.