Multiprogramming Operating System

For Complete YouTube Video: Click Here

In this class, we will try to understand Multiprogramming Operating System.

We already had a brief discussion on multiprogramming operating system in our previous class.

Multiprogramming Operating System

The name multiprogramming operating system states that multiple processes will get executed simultaneously on the computer.

In reality, at any point, only one process will get executed.

To understand this concept, we will consider the image shown below.

In the above image, we see that three programs are getting executed, and we have only one CPU.

The CPU will execute only one program or process at any time.

How are we getting the effect of multiprogramming or simultaneous execution?

We will get the effect of multiprogramming because of the speeds of the processors.

An I7 processor with 2.2GHz can execute 1 Billion instructions per second.

The operating system will utilize the speeds of the CPU and will create the effect of multiprogramming.

Each process will utilize the CPU time for a specific amount of time.

For example, the word document will utilize the CPU time for 100ms, the music player will use the CPU for the next 100ms, and the movie download is done for the next 100ms.

The rate at which the process will get allocated to the CPU is significantly faster. The human brain cannot sense the effect of changing the process.

Another reason for multiprogramming is the program waiting for its IO Operation to be done.

To understand this, let’s consider the movie download.

The movie that is getting downloaded will get stored on the hard disk.

Storing the movie onto the hard disk is an IO operation.

To do an IO operation will take a lot amount of time.

While doing the IO operations, the CPU will sit idle. We need to utilize the CPU resources more efficiently.

We will allocate the CPU resources to another process to use the CPU resources efficiently.