Multiprogramming

Learn what multiprogramming is, and how it works.

Multiprogramming

Slow peripheral devices cause the CPU to idle. This problem led OS developers to the concept of multiprogramming. This concept implies that the OS loads several programs into the computer memory at the same time. The first program works as long as all resources it needs are available. It stops execution once a required resource is busy. Then, the OS switches to another program.

We’ll go over an example. Let’s suppose that our application wants to read data from our hard disk. While the disk controller reads the data, it’s busy. It cannot process the following requests from the program. So, the application waits for the controller. In this case, the OS stops executing it and switches to the second program. The computer then executes the second program to its end or until it has all the required resources. When the second program finishes or stops, the OS switches tasks again.

Get hands-on with 1200+ tech skills courses.