Professional Documents
Culture Documents
Y10-04-P21: OS: Process Management
Y10-04-P21: OS: Process Management
Y10-04-P21: OS: Process Management
Learning objectives
In this lesson you will learn to:
• Describe how an OS uses scheduling to give each active
process a share of CPU time
• Describe how the OS uses paging and virtual memory to share
RAM between processes
For more information and additional student activities see Topic 3.2
of the student book.
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-04-P21: OS: process management
Operating systems
Previously you learned the main functions of operating systems:
• process management
• file management
• user management
• peripheral management.
In this lesson, you will learn about how the OS manages processes.
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-04-P21: OS: process management
Processes
• When a program is run, it is copied from the secondary storage
into the memory so that it can be executed by the CPU.
• Programs in the memory that are being executed (or waiting to be)
are called processes.
• Some processes are visible to the user, but there are many that
run in the background.
• Often there are many processes that need to access the CPU
simultaneously.
• As each CPU can only carry out one instruction at a time, the OS
is responsible for allocating CPU time to each of the processes,
alongside access to other hardware such as the memory and
peripherals.
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-04-P21: OS: process management
Multitasking
• Modern CPUs and operating systems are able to make multiple
processes available at the same time.
• This is known as multitasking.
• The OS is responsible for ensuring that all processes are able to
execute by allocating them a fair share of time with the hardware.
It is important to understand this distinction:
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-04-P21: OS: process management
Processes
• It is possible to see the processes that your computer is running.
• In Windows, you can use the Task Manager to view the processes
running on your machine.
• The Task Manager gives you an overview of how many resources
each process is using.
• In this example, you can
see that there a number of
background processes
listed – lots of them!
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-04-P21: OS: process management
Scheduling
• The OS uses a scheduling algorithm to ensure that all processes
that are queueing to be carried out get a share of CPU time.
• There are three main scheduling algorithms that OSs use:
• First In First Out (FIFO) – this processes the queue in the
order that items arrive. The process at the front of the queue
runs first, then the next, etc.
• Shortest Job First – the process which is closest to being
completed goes first.
• Round-robin – processes are allocated a time slice (an amount
of time in the CPU). If the process is not complete at the end of
its time, it goes to the back of te queue. Higher priority tasks
are given more time slices.
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-04-P21: OS: process management
Memory
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-04-P21: OS: process management
Virtual memory
• When many processes are running a computer’s RAM may
become full.
• When this happens, the OS needs to temporarily move some of
the contents of the RAM to a space on the hard drive.
• The part of the hard drive designated as an extension to the main
memory is called virtual memory.
• The OS moves the pages of memory associated with a process in
RAM to the hard disk. Thereby freeing up some memory.
• When that process is ready to be executed again, the OS moves
the page from virtual memory back into RAM.
• You might have witnessed this happening (particularly on an older
machine) when you’ve reopened a program that had been
minimized for a while – the program may have taken a few
seconds to be ready to reload.
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-04-P21: OS: process management
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.