Last updated: Oct 16, 26 03:01 UTC | Permalink
8 - Concurrency Patterns in Typescript
Learning Objectives:
A 1 GHz CPU executes an instruction every 1 ns. Almost anything else takes approximately forever. Rather than waste time waiting for a long-running operation to complete, we want our programs to make progress on other tasks. This is called “masking latency with concurrency”.
In this lecture, we will study some common patterns for organizing concurrency in Typescript/Javascript.
By the end of this lesson, you should be prepared to:
- Explain the difference between JS run-to-completion semantics and interrupt-based semantics.
- Given a simple program using async/await, work out the possible orders in which the statements in the program will run.
- Write simple programs that create and manage promises using async/await
- Write simple programs to mask latency with concurrency by using non-blocking IO and Promise.all in TypeScript.
Important Dates:
- Individual Project 2 Due Wednesday, Oct 7 by 5pm (EST)
- Preliminary Project Plan Due Friday, Oct 16, 2026 by 5pm (ET)
Lecture Slides:
- Concurrency Patterns in Typescript Slides PDF, PPT