Skip to main content

External Exercises

Practice concurrency fluency on external platforms after you have completed the concept pages, practice pages, and code katas in this module.

How To Use This Page​

  1. Finish the relevant concept and the matching kata first.
  2. Solve at least one problem from memory.
  3. Only then open the exercise lane below.
  4. Keep a mistake log with tags such as forgot while on cond wait, lock order violation, missing memory ordering, starved writer, ABA, blocked event loop.

Beginner Level​

pthreads Fluency​

Shared State​

Intermediate Level​

Bounded Buffer and Producer-Consumer​

Readers-Writers and Classical Problems​

Memory Ordering​

  • CppCon atomic examples (search "atomic" or "memory model") - Short snippets; reason about which ordering is minimal.

Advanced Level​

Lock-Free Structures​

Concurrency Debugging​

  • CS:APP Malloc Lab - Threadsafe - Harden a malloc implementation against concurrent callers.
  • Jepsen writeups - Read a Jepsen analysis of a real system (MongoDB, Postgres, Cassandra). Map the failure back to a Coffman condition or a memory-ordering bug.

Systems Projects​

Completion Checklist​

  • Completed at least 3 beginner problems across different primitives
  • Implemented the bounded blocking queue with both mutex+condvar and semaphores
  • Implemented dining philosophers with a deadlock prevention fix and verified non-cyclic waits-for
  • Attempted at least one advanced problem (Michael-Scott queue or hazard pointers)
  • Mistake log contains at least 10 tagged entries with reproducible minimal examples
  • Ran at least 2 programs under ThreadSanitizer and fixed anything it flagged

Required queue-contract extension​

Complete Bounded queues, wakeups and graceful close and all CQ1–CQ6. This 22–32-hour package replaces the former three-hour queue exercise; original concurrency practice remains required.