Open In App

Multiprogramming in Operating System

Last Updated : 05 Mar, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

As the name suggests, more than one programs can be active at the same time. Before the concept of Multiprogramming, there were single tasking operating systems like MS DOS that used to allow only one program to be loaded at a time and run. These systems were not efficient as CPU was not used efficiently. For example, in a single tasking system if the current program waits for some input/output to finish, the CPU is not used. The idea of multiprogramming is to assign CPUs to other processes while the current process might not be finished. This has the below advantages.

1) User get the feeling that he/she can run multiple applications on a single CPU even if the CPU is running one process at a time.
2) CPU is utilized better

All modern operating systems like MS Windows, Linux, etc are multiprogramming operating systems,

Multiprogramming in Operating System

Features of Multiprogramming

  1. Need Single CPU for implementation.
  2. Context switch between process.
  3. Switching happens when current process undergoes waiting state.
  4. CPU idle time is reduced.
  5. High resource utilization.
  6. High Performance.

Disadvantages of Multiprogramming

  1. Prior knowledge of scheduling algorithms (An algorithm that decides which next process will get hold of the CPU) is required.
  2. If it has a large number of jobs, then long-term jobs will have to require a long wait.
  3. Memory management is needed in the operating system because all types of tasks are stored in the main memory.
  4. Using multiprogramming up to a larger extent can cause a heat-up issue.

Scheduling Algorithms are of two types.

  1. Preemptive Scheduling algorithm: In the preemptive scheduling algorithm if more than one process wants to enter into the critical section then it will be allowed and it can enter into the critical section without any interruption only if no other progress is in the critical section.
  2. Non-Preemptive scheduling algorithm: If a process gets a critical section then it will not leave the critical section until or unless it works gets done.

How do Multiprogramming Operating Systems Work?

In multiprogramming system, multiple programs are to be stored in memory and each program has to be given a specific portion of memory which is known as process. The operating system handles all these process and their states. Before the process undergoes execution, the operating system selects a ready process by checking which one process should udergo execution. When the chosen process undergoes CPU execution, it might be possible that in between process need any input/output operation at that time process goes out of main memory for I/O operation and temporarily stored in secondary storage and CPU switches to next ready process. And when the process which undergoes for I/O operation comes again after completing the work, then CPU switches to this process. This switching is happening so fast and repeatedly that creates an illusion of simultaneous execution.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads