Open In App
Related Articles

Multiprogramming in Operating System

Like Article
Save Article
Report issue

Multiprogramming in an operating system as the name suggests multi means more than one and programming means the execution of the program. when more than one program can execute in an operating system then this is termed a multiprogramming operating system.

Before the concept of Multiprogramming, computing takes place in other way which does not use the CPU efficiently.Earlier, CPU executes only one program at a time. In earlier day’s computing ,the problem is that when a program undergoes in waiting state for an input/output operation, the CPU remains idle which leads to underutilization of CPU and thus poor performance . Multiprogramming addresses this issue and solve this issue.

Multiprogramming was developed in 1950s. It was first used in mainframe computing.

The major task of multiprogramming is to maximize the utilization of resources. Multiprogramming is broadly classified into two types namely 

  1. Multi-user operating system
  2. Multitasking operating system

Multiuser and Multitasking both are different in every aspect and multitasking is an operating system that allows you to run more than one program simultaneously. The operating system does this by moving each program in and out of memory one at a time. When a program runs out of memory, it is temporarily stored on disk until it is needed again. 

A multi-user operating system allows many users to share processing time on a powerful central computer on different terminals. The operating system does this by quickly switching between terminals, each receiving a limited amount of CPU time on the central computer. Operating systems change so rapidly between terminals that each user appears to have constant access to the central computer. If there are many users on such a system, the time it takes for the central computer to respond may become more apparent.

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 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.

Multitasking is a method that is divided into 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 choosen 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.

Last Updated : 19 Jul, 2023
Like Article
Save Article
Share your thoughts in the comments
Similar Reads