Learning Resources
This module is populated from the local chunked books in library/raw/semester-05-os-networking/books and a small, curated set of external resources. Use this page as a source map, not as an instruction to read everything.
Source Stack
| Book | Role | How to use it in this module |
|---|---|---|
| Operating Systems: Three Easy Pieces (OSTEP) | Primary teaching source | Default escalation for threads, locks, condition variables, semaphores, classic problems, and deadlock |
| Operating System Concepts (Silberschatz) | Selective support | Use when you want a more formal and textbook-style treatment, especially of the critical-section problem, monitors, and deadlock conditions |
| Unix Network Programming (Stevens) | Selective support | Use for pthreads API details, race-condition case studies, and cross-process synchronization idioms |
Resource Map by Cluster
Cluster 1: The Race Condition Problem
| Need | Best local chunk | Why |
|---|---|---|
| what threads and shared state are | OSTEP 26: Concurrency - An Introduction | Best first framing of shared state |
| thread creation in practice | OSTEP 26.1: An Example, Thread Creation | Concrete pthread example |
| why shared data makes things worse | OSTEP 26.2: Why It Gets Worse - Shared Data | The canonical counter example |
| scheduling as the root of races | OSTEP 26.3: The Heart of the Problem | Best explanation of why races exist |
| concurrency terminology | OSTEP: Key Concurrency Terms | Compact glossary |
| critical section formalism | OSC 6.2: The Critical-Section Problem | Formal statement of mutex/progress/bounded-wait |
| race condition case study | UNP: Race Conditions (Part 1) | Real network-programming context |
| hardware atomics | OSTEP 28.6: Test-And-Set (Atomic Exchange) | Introduces TAS and why it matters |
Cluster 2: Locks and Mutual Exclusion
| Need | Best local chunk | Why |
|---|---|---|
| pthread lock basics | OSTEP 27.3: Locks | API-first introduction |
| what a lock is | OSTEP 28.1: Locks - The Basic Idea | Correctness obligations named |
| test-and-set | OSTEP 28.6: Test-and-Set | Minimal spinlock derivation |
| building a spin lock | OSTEP 28.7: Building a Working Spin Lock | Best constructive explanation |
| LL/SC and CAS | OSTEP 28.10: Load-Linked / Store-Conditional | Alternate hardware primitive |
| fetch-and-add and ticket locks | OSTEP 28.11: Fetch-and-Add | Fair-lock foundation |
| when to sleep instead of spin | OSTEP 28.14: Using Queues - Sleeping Instead of Spinning | Why blocking mutexes exist |
| adaptive mutex | OSTEP 28.16: Two-Phase Locks | Practical production pattern |
| pthread mutex details | UNP: Mutexes - Mutual Exclusion | API and patterns |
| concurrent counter | OSTEP 29.1: Concurrent Counters | First data-structure case |
| concurrent list | OSTEP 29.2: Concurrent Linked Lists | Hand-over-hand locking |
| concurrent hash table | OSTEP 29.4: Concurrent Hash Table | Striping in practice |
Cluster 3: Coordination Primitives
| Need | Best local chunk | Why |
|---|---|---|
| condvar API | OSTEP 27.4: Condition Variables | pthread introduction |
| condvar semantics | OSTEP 30.1: Definition and Routines | Formal behavior |
| classic bounded buffer | OSTEP 30.2: Producer-Consumer (Part 1) | Canonical design walk-through |
| buffer evolution and signal/broadcast | OSTEP 30.2: Producer-Consumer (Part 2) | Why two condvars, why signal vs broadcast |
| when broadcast is needed | OSTEP 30.3: Covering Conditions | The motivating example |
| semaphore init | OSTEP 31.1 Figure | Counting semaphore usage |
| semaphores as condvars | OSTEP 31.3 | Strengths and limits of semaphores |
| semaphore bounded buffer | OSTEP 31.4 | Alternate solution to the canonical problem |
| monitor usage | OSC 6.7.1: Monitor Usage | Formal monitor construct |
| Java monitors | OSC 7.4.1: Java Monitors | Language-integrated version |
| condition variable theory | OSC 7.4.4: Condition Variables | Mesa semantics explained |
| UNP condvar + IPC | UNP: Condition Variables | API-level reference |
Cluster 4: Classic Concurrency Problems
| Need | Best local chunk | Why |
|---|---|---|
| readers-writers | OSTEP 31.5: Reader-Writer Locks | Reference implementation |
| dining philosophers | OSTEP 31.6: The Dining Philosophers | Canonical deadlock example |
| summary of classic problems | OSTEP 31.8: Summary | Short recap |
Cluster 5: Lock-Free and Modern Concurrency
| Need | Best local chunk | Why |
|---|---|---|
| common concurrency bugs taxonomy | OSTEP 32: Common Concurrency Problems | Empirical bug classification |
| non-deadlock bugs | OSTEP 32.2: Non-Deadlock Bugs | Atomicity-violation and order-violation |
| deadlock bugs | OSTEP 32.3: Deadlock Bugs | The four-condition analysis |
| conditions for deadlock | OSTEP: Conditions for Deadlock | Coffman's conditions |
| deadlock methods overview | OSC Chapter 8: Deadlocks | Prevention / avoidance / detection |
| formal necessary conditions | OSC 8.3.1: Necessary Conditions | Standard textbook treatment |
| handling deadlock | OSC 8.4: Methods for Handling Deadlocks | Strategy comparison |
| event-based concurrency motivation | OSTEP 33.3: Using select | Where event loops came from |
| state management in async | OSTEP 33.7: State Management | Why single-threading does not remove all bugs |
External Resources
Treat these as escalation only. Use them when the local chunks do not answer the specific question you have.
Memory Model and Lock-Free
- Preshing: An Introduction to Lock-Free Programming - Clearest short introduction to the topic.
- Preshing: Acquire and Release Semantics - The best informal explanation of
memory_order_acquire/release. - Preshing: Atomic vs Non-Atomic Operations - What atomicity does and does not buy you.
- Herb Sutter: Welcome to the Jungle - Why concurrency is now a first-class programming concern.
- Paul McKenney: Is Parallel Programming Hard, And, If So, What Can You Do About It? (perfbook) - Book-length depth on parallel programming, RCU, memory ordering, and concurrency patterns in Linux.
- Linux kernel: Documentation/memory-barriers.txt - Canonical explanation of memory barriers and ordering as practiced in the kernel.
Official API Documentation
- GCC: Built-in functions for atomic memory access -
__atomic_*builtins and ordering specifiers. - cppreference:
<stdatomic.h>- C11 atomics reference. - cppreference:
std::memory_order- C++ memory orderings with examples. - pthread_mutex_lock(3p) - POSIX mutex specification.
- pthread_cond_wait(3p) - POSIX condition variable specification.
- sem_wait(3p) - POSIX semaphore specification.
Async / Event-Loop
- Python: asyncio documentation - Official reference for Python async.
- Node.js: The Event Loop, Timers, and process.nextTick - Official explanation of the Node event loop phases.
- Rust async book: Getting Started - Official intro to async Rust.
Use Rules
- If you are stuck on the core mechanics, go to OSTEP first.
- If you need a more formal textbook treatment (critical-section theorem, monitor formal semantics, Coffman conditions as a theorem), go to Operating System Concepts.
- For exact pthread API behavior, consult the man pages (
man 3 pthread_mutex_lock) or UNP chunk references. - For memory ordering and lock-free, the preshing articles and the GCC docs are the shortest path to correctness.
- Do not read any chunk by default; open one chunk for one gap.