mateusz@systems ~/book/execution $ cat chapter.md

Chapter 1

Processes, Threads & Parallelism

Most user-space execution on Linux runs in processes, each containing one or more threads. How those execution contexts are created, scheduled, isolated, and coordinated shapes both performance and failure behavior, from a single service to a fleet of batch jobs.

This chapter covers the fundamentals of processes and threads, per-thread state, the primitives that coordinate shared state, the hardware locality costs of sharing it (false sharing and NUMA), signals, patterns for running jobs in parallel, resource control with cgroups, and techniques for moving data between processes without wasting cycles.

Performance work on modern hardware is mostly about locality: keeping data close to the cores that use it and avoiding invisible contention. The costs hide in cache lines, memory nodes, and coherence traffic rather than in the code you can read—false sharing, where different processors concurrently access independent variables in the same cache line and at least one access is a write, and NUMA, where memory is closer to some cores than others.

# Chapter Sections