M18 - Process Model: What Processes Are
Process Model: What Processes Are
Understand the difference between a program stored on disk and a process running in memory, and learn the basic ideas of PID, parent process, and thread.
- Explain the difference between a program and a process.
- Recognize that each process has an identity such as a PID.
- Understand that processes can create child processes and use threads.
Why This Matters
A program on disk is potential. A process in memory is that program actually running.
That difference matters because most system problems are process problems, not file problems:
- an app is frozen
- a service is using too much CPU
- a child process will not exit
- many copies of the same program are running
1. Program Versus Process
A program is the file stored on disk.
A process is one running instance of that program, with:
- memory allocated
- an identity inside the OS
- current state such as running, waiting, or stopped
One program can produce many processes. Opening the same browser twice does not create a second browser file on disk. It creates additional running work.
2. PID: The Process Identity
Each process gets a process ID, usually called a PID.
That number is useful because names alone can be ambiguous. You may have several python or node processes at once, but each PID is distinct.
When you inspect or manage a process, the PID gives you a precise target.
3. Parent and Child Processes
Processes often create other processes.
Examples:
- a terminal launches a shell
- the shell launches a script
- the script launches another command
That creates a parent-child relationship. Understanding that chain helps explain why killing one process may or may not end the work beneath it.
4. Threads Are Smaller Units of Work
A process can also contain multiple threads.
A beginner-friendly way to think about this is:
- a process is the main running container
- threads are multiple lanes of work inside that same process
You do not need deep thread internals yet. You only need the idea that one process can still do more than one thing at a time.
Useful Rule
When something is “running,” ask first whether you are talking about a program on disk, a process in memory, or a thread inside that process. The distinction prevents a lot of confusion.
What to Ignore for Now
- scheduler internals
- detailed process states beyond the basic idea
- low-level memory maps and kernel structures
The goal here is just to make the process model feel real.
Before You Move On
You are ready for the next lesson when you can explain:
- program versus process
- why PIDs matter
- what parent and child processes mean
Next, we look at processes in graphical tools before moving to the CLI.