Level 0 · Module 1
Processes and programs
Distinguish stored program code from a running instance of that code.
Not completed
By the end, you can
- Distinguish a program from a process.
- Identify resources a process uses while running.
- Explain how multiple process instances can run the same program.
Summary
A program is code and related files stored on a device. A process is one running copy of that program. While it runs, it has its own working information and resources managed by the operating system.
Introduction
An application icon or file on storage is not doing work. When you open it, the operating system creates a process and gives it the resources it needs so the CPU can execute its instructions.
Explanation
A process has an identifier, working memory, information about open files, and a current execution state. Operating systems use the term virtual memory space for the memory area assigned to a process. Launching the same app twice can create separate processes even though both started from the same installed program. The operating system gives runnable processes turns using CPU time.
Real-world example
Two independently launched editor instances use the same program stored on disk. Each can have its own unsaved document and working memory, so the operating system manages them as separate processes. A window is not automatically the same thing as a process: one app can use several processes, or one process can have no visible window.
From stored file to running work
Interactive exploration
One program, separate processes
Step 1 of 4
The operating system switches between runnable processes quickly, giving each one a turn on the CPU. This is why several apps can appear to run together. The exact details vary by operating system, but the stored-program versus running-process distinction remains useful.
Code example
program: notes-app (stored on disk)
process 4312: notes-app, document = ideas.txt
process 4827: notes-app, document = budget.txtCommon mistakes
- Using “program” and “process” as interchangeable terms.
- Assuming one application always has exactly one process.
- Believing a stopped process still keeps unsaved RAM data available after it exits.
Quiz
Knowledge check
Try it
Spot the distinction
Describe what changes when you download a music player, launch it, and then open two separate player windows.
Key takeaways
- Programs are stored instructions; processes are executing instances.
- A process has active state such as a virtual memory space and open resources.
- The operating system manages processes and shares CPU time among them.