A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Processes and the Process Control Block

College Depth 93 in the knowledge graph ☐ I know this ☆ Set as goal
110topics build on this
355prerequisites beneath it
See this on the map →
Instruction Set Architecture (ISA)Assembly Language Basics+2 more→→File Descriptor Tables and I/O RedirectionInter-Process Communication (IPC)+9 more
process PCB program-counter address-space

Core Idea

A process is a program in execution — an active entity that includes the program code, current activity (program counter, registers), stack, heap, and data segment. The operating system represents each process with a Process Control Block (PCB), a data structure storing process state, PID, register values, memory maps, open file descriptors, and scheduling information. Multiple processes may run the same program but maintain separate address spaces, so they do not interfere with each other's data. The PCB is saved and restored during context switches.

How It's Best Learned

Inspect /proc/<pid>/ on Linux to see the live PCB-equivalent data. Write a fork() program and observe how parent and child diverge despite sharing the same code.

Common Misconceptions

Explainer

From your study of instruction set architecture, you know that a CPU executes a sequence of instructions, maintaining state in registers like the program counter (which instruction to execute next) and the stack pointer. A process is what happens when the operating system takes a passive program — a file sitting on disk — and brings it to life as an active, running entity with its own registers, memory, and system resources.

A process is more than just code. It encompasses the text segment (the compiled machine instructions), the data segment (global and static variables), the heap (dynamically allocated memory that grows upward), and the stack (function call frames, local variables, and return addresses that grows downward). Each process also maintains CPU state: the current values of all registers, the program counter pointing to the next instruction, and the processor status word. Together, these components define the complete execution context — everything needed to pause a process and resume it later exactly where it left off.

The operating system tracks all of this in a data structure called the Process Control Block (PCB). Every process has one. The PCB stores the process ID (PID), current process state (running, ready, waiting), saved register values, memory management information (page tables, segment limits), I/O status (open file descriptors, pending I/O operations), and scheduling data (priority, CPU time consumed). When the OS switches the CPU from one process to another — a context switch — it saves the running process's register values into its PCB, then loads the next process's saved registers from its PCB. The CPU seamlessly resumes the new process as if it had never stopped. This save-and-restore cycle is what enables multitasking: dozens of processes take turns on the CPU, each unaware of the others.

The critical insight is that processes are isolated by default. Two processes running the same program binary have completely separate address spaces — process A's variable `x` at virtual address 0x1000 and process B's variable `x` at virtual address 0x1000 refer to different physical memory locations. Neither can read or corrupt the other's data. This isolation is enforced by the hardware memory management unit, which the OS configures separately for each process. When processes do need to communicate, they must use explicit inter-process communication (IPC) mechanisms — pipes, shared memory segments, message queues, or sockets — that the OS mediates and controls.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Fixed-Point Number Representation → Two's Complement Representation → Overflow and Underflow Detection → Binary Adders: Half-Adders and Full-Adders → Full Adder and Carry Propagation → Carry Lookahead Adder Design → Half Adder Circuit Design → Multiplication Circuit Design → Sequential Circuit Design → Registers and Register Files → Instruction Set Architecture (ISA) → Kernel Architecture and OS Structure → System Calls and User/Kernel Mode → Processes and the Process Control Block

Longest path: 94 steps · 355 total prerequisite topics

Prerequisites (4)

Leads To (11)