A task is a distinct part of a program’s work that can proceed with little or no interaction with other tasks. Threads provide separate control flows for executing tasks concurrently, either simultaneously on multiple processors or through interleaving. section 20.0
A task can represent an independent responsibility, such as:
- Drawing a cell matrix to a terminal. section 20.0
- Capturing keystrokes, moving the cursor, and creating cells. section 20.0
- Updating game state from one life cycle to the next. section 20.0
- Counting living neighboring cells, tightly coupled with updating. section 20.0
Figure 20.1 Control flow of the five threads of B9
A control-flow diagram helps show how independent task loops interact across the program’s threads. section 20.0









