seegongsik
Operating systems

What is a process in an OS

Double-click an app icon and the program "runs." But what exactly does running mean? It's the moment a file that was just sitting there becomes something alive and moving.

01

A program and a running program are different

First, let's separate two things. One is the program: a file sitting still in storage.
The other is that program in a running state, alive and working right now.
It's the difference between a recipe on paper and actually cooking.

Program (code)

A file sitting still in storage. Like a sheet of paper with a recipe on it.

Not moving yet

Process (running)

That program actually running. Cooking while reading the paper.

Alive and working now

Two things that look alike but aren't, side by side.

A running program is called a process.
Just as a recipe only produces steam and smells once you start cooking, a program only starts doing real work once it runs.

02

Running a program gives birth to a process

The moment you double-click an app, the operating system gets to work. It loads the code from storage into memory and wakes it up: "Okay, start now."
This awakened state is the process. Try running one yourself below.

Notepad.app
Asleep in storage
Run→
Notepad
Not awake yet

Press run, and a process wakes up from the sleeping file.

The file stays where it is. A copy is loaded into memory and becomes the process.
That's why turning the same app off and on again doesn't change the original file.

03

A process gets its own space

When a process is born, the operating system gives it a place: "You use these memory cells."
That's the very memory with addresses we saw earlier in computer structure. Each process gets its own separate workspace.

Notepad process
Its own memory space
Music process
Its own memory space
Each has its own space, so if one program freezes another is fine.

Each process has its own memory space.

Because their spaces are separate, they don't interfere with each other. Even if one app suddenly freezes, the others are fine.
The operating system has divided things up so what's mine and what's yours never mix.

04

You can open several copies of the same app

Here's something interesting: there's one program, but there can be several processes.
Open three browser windows, and the same program has produced three processes.
Open more windows and see for yourself.

Window 1
#201
1 process now

Each window you open adds one process.

Just as one recipe can be used to cook in several pots at once, one program can run as several processes,
each working separately in its own space.

05

The operating system keeps a list of them all

The operating system holds a list of every process running right now: what it's called, how hard it's working, how much memory it uses.
When your computer slows down, the list you see in the task manager is exactly this list.

#101Browser
Running
#102Music
Running
#103Messages
Running
#104Notepad
Running

The operating system gives each of these a number (PID) and manages them separately.

Each process lives and moves in its own space, and the operating system keeps track of them all on its list.
But if there's only one of each part, how can so many processes run at the same time? We'll unravel that secret in the next lesson.

In one lineA program is a file sitting still; a process is that program running, alive and moving. Each process has its own memory space, so even if one stops, the others are fine.
← Operating systems
Was this helpful? Support seegongsik