Course contents
On this page
Lesson plan 03: Local concurrency and execution
Compare a thread-per-request server with an event loop under blocking and independent work.
Placement: Part 1: Foundations: understanding work, time, and resources.
Prerequisites: Lesson 02: Hardware and operating-system costs, plus the earlier dependency chain.
Learning outcomes
- Compare a thread-per-request server with an event loop under blocking and independent work.
- Identify synchronization and scheduling costs that limit parallel speedup.
- Explain why many waiting requests do not imply many requests executing simultaneously.
- Separate a general mechanism, a documented implementation choice, and an illustrative numerical assumption.
Teaching sequence
- Establish the motivating situation: Ten thousand connected clients compete for a much smaller number of execution resources.
- Introduce the vocabulary and the correctness obligation before an optimization. Define processes, threads, event loops.
- Develop the mechanism: Follow ownership of a request through accept, queue, runnable work, blocking work, and completion; locate synchronization boundaries.
- Follow the complete worked example: 20000 operations/s at 5 ms mean residence time implies 100 operations in flight. Explain the assumptions, intermediate units, and limiting interpretation.
- Extend the scenario to changed load, skew, or failure, explaining scheduling, synchronization, concurrency, parallelism.
- Connect the mechanism to a documented implementation and an alternative with a different workload fit. Close by stating the remaining cost and the next lesson dependency.
Required chapter material
Use a complete execution trace or worked calculation, supported by an annotated static diagram or table. Include language-neutral pseudocode or labeled SQL when it clarifies the mechanism. State preconditions, ownership, visibility, and failure boundaries for algorithms. Describe operational costs as well as the normal path. All questions raised in the narrative must be resolved in the text.
Visual explanation
A scheduling timeline places CPU execution and I/O waits on separate lanes and shows contention on a shared state transition. The accompanying prose explains the arrows, state changes, or table entries so the lesson remains understandable in a plain Markdown reader.
Editorial checks
Confirm that the numerical example agrees with its units and assumptions. Check that a faster path preserves the stated contract, or explicitly identify the changed guarantee. Keep hypothetical figures separate from product measurements. Explain both an appropriate use and a limitation of the case design. Check terminology against the glossary and links against the course index.