seegongsik
Saved words
Operating systems

One pretending to be many

Music playing, writing a doc, a download too. Seems like all at once, right? Really, the worker (CPU) is just one. It switches between them so fast, a little at a time, that to our eyes it looks like it all happens together.

01

Everyone wants a turn

Play music,
write a doc,
download a file.
All three need the worker (CPU).
But there's only one worker.
Three can't use
one worker all at once.
So what do we do?

Play musicneeds the worker
Write a docneeds the worker
Download a fileneeds the worker
workerCPU
All three want the single CPU. But they can't all use it at once.

Three jobs · only one worker.

Saw it in lesson 2?
A running program is a process.
Right now there are three processes,
but one worker.
How three share
this one,
that's today's story.

02

Take quick turns

Here's how.
The worker does music a moment,
the doc a moment,
the file a moment.
A tiny bit each,
then on to the next.
Around once, then again.
Press the button and watch.

Now doing·
Music0%
Doc0%
File0%
The worker takes each in quick turns. The three bars fill a little together.

The worker switches a little at a time → all three inch forward.

It does one at a time.
But it switches so fast
that all three seem
to move without stopping.
The worker is really
going back and forth
between jobs without rest.

03

The illusion that speed makes

The trick is speed.
Switch slowly
and you see all the taking turns.
"Ah, one at a time."
But switch very fast
and to human eyes
the gaps vanish.
So it feels simultaneous.

Now doingMusic
Music
Doc
File
Slow · you can see the turns
When slow, you clearly see the worker take one at a time.

Move the switching speed.

A real computer
switches the worker
thousands of times a second.
People can't feel
that speed at all.
So we believe it's all at once.
Really it's very fast
taking turns.

04

Your device does this too

The very device
you're reading this on does the same.
Drawing the screen,
making sound,
checking the connection.
Dozens of jobs
seem to run,
but the worker is switching fast.

Music
playing
Browser
this page
Messenger
waiting
all taking turns on one worker
CPU · switching without rest
That one CPU worker from structure is used, sliced this fine.

On your device right now (one worker taking turns).

Amazing, right?
That smoothness we feel
as many at once
is really an unseen housekeeper
slicing the worker fine
and sharing it out.
The operating system
does this behind the scenes.

05

Fast turns, that one thing

Today's one thing is this.
Even with one worker,
switching fast
makes many look simultaneous.
This is time-sharing.
But to take turns,
you'd have to stop a job
and pick it up again, right?

Taking turns = pretending to be many
One worker · switching fast a little at a time · so it looks simultaneous.
Stop and resume
how it changes places
Who first
how order is decided
Beyond
deeper housekeeping
Next time we'll touch how a job is stopped and picked back up, the place-swap.

Once you know taking turns, now.

Thanks to the OS
slicing the worker fine,
we enjoy many jobs
on one machine.
"One pretending to be many."
This simple trick
makes a computer far more useful.

In one lineThe worker (CPU) is just one, but switching between tasks very fast, a little at a time, makes many look simultaneous. This is time-sharing. The smoothness we feel as all at once is really the OS slicing one worker fine and sharing it out.
Was this helpful? Support seegongsik
Operating systems