Concurrency and Threads

Stub. Why concurrency is hard (interleaved execution on shared state), the thread abstraction as a unit of concurrency sharing an address space, and the thread API — creating, joining, and coordinating threads.

· 1 min read · 140 words

A thread is what you get when you split a process’s single flow of control into several, all sharing one address space — cheaper to create and switch between than a process, but exposed to every race condition that shared mutable state invites the moment two threads interleave unpredictably. Covers the concurrency problem in the abstract (why “correct in isolation” doesn’t imply “correct interleaved”), the thread abstraction itself, and the basic thread API for creating and joining threads — the foundation the locking/synchronization primitives and the concrete POSIX threads API build on.

Outline (TODO — flesh out each)

  • Why concurrency is hard — interleaving, race conditions
  • The thread abstraction
  • The thread API — create, join
  • A first look at shared state and the need for mutual exclusion

← All notes