Process (computing)
Welcome to the second episode on Operating Systems! This session introduces the fundamental concept of a **process**. We'll distinguish between a passive *program* on your disk and an active *process* that is running. You will learn about the internal anatomy of a process, including its memory layout with the stack, heap, and code sections. We will delve into the **Process Control Block (PCB)**, the critical data structure the OS uses to manage every process. This episode also explores the dynamic lifecycle of a process, explaining its different states—such as *new*, *ready*, *running*, and *waiting*—and how it transitions between them. This is your first step to understanding how operating systems manage multiple applications.
Check your understanding
These are the same multiple-choice questions you will see in the Quiz section after you listen to the episode. Use them here to preview or review the answers.
What is the key difference between a program and a process?
- A program is active in memory, while a process is a passive file on disk.
- A process is an active instance of a program being executed, while a program is a passive file of instructions.
- A process consists of only a stack and a heap, while a program is the source code.
- There is no difference; the terms are used interchangeably.
- A computer can only have one program but many processes.
Which of the following pieces of information are typically stored in a Process Control Block (PCB)? (Select all that apply)
- The process's current state (e.g., running, waiting).
- The source code of the program.
- The unique Process ID (PID).
- The values of CPU registers when the process is not running.
- The name of the user who wrote the program.
A process is currently in the 'Running' state. What could cause it to transition to the 'Waiting' (or 'Blocked') state?
- The operating system scheduler decides to run a different process.
- The process finishes its execution completely.
- The process initiates an I/O operation, like reading from a file.
- A new process is created by the user.
- The process has been in the 'Ready' queue for too long.
What is the primary purpose of the 'stack' within a process's memory layout?
- To store the program's machine code instructions.
- To store global variables that exist for the entire life of the process.
- To store dynamically allocated memory requested during runtime.
- To store temporary data for function calls, like local variables and return addresses.
Why does an operating system need to provide Inter-Process Communication (IPC) mechanisms?
- To allow the kernel to communicate with device drivers.
- Because processes operate in isolated memory spaces but sometimes need to cooperate and share data safely.
- To allow a single process to execute its code more quickly.
- To ensure that all processes have a unique Process ID.
- To manage the transition of processes between the 'Ready' and 'Running' states.
Suggested next
Related episodes that are a natural follow-on.
Often studied before
Episodes that tend to come earlier on similar paths.