The Wayback Machine - https://web.archive.org/web/20240630155122/https://www.geeksforgeeks.org/multiprogramming-in-operating-system/
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.


Previous Article
Next Article

Similar Reads

Difference between Multiprogramming, multitasking, multithreading and multiprocessing
Multiprogramming - Multiprogramming is known as keeping multiple programs in the main memory at the same time ready for execution.Multiprocessing - A computer using more than one CPU at a time.Multitasking - Multitasking is nothing but multiprogramming with a Round-robin scheduling algorithm.Multithreading is an extension of multitasking.FeatureMul
11 min read
Difference between Multiprogramming and Multitasking
Both Multi-programming and Multi-tasking are related to Operating Systems Concepts CPU is a super fast device and keeping it occupied for a single task is never a good idea. Considering the huge differences between CPU speed and IO speed, many concepts like multiprogramming, multitasking, multithreading, etc have been introduced to make better CPU
3 min read
Difference between Multiprogramming and Multithreading
1. Multi-programming : Multi-programming is more than one process running at a time, it increases CPU utilization by organizing jobs (code and data) so that the CPU always has one to execute. The motive is to keep multiple jobs in main memory. If one job gets occupied with Input/output, CPU can be assigned to other job. 2. Multithreading : Multithr
2 min read
Difference between Time Sharing OS and Multiprogramming OS
Prerequisite - Different types of Operating System 1. Time Sharing : Time Sharing is the logical extension of multiprogramming, in this time sharing Operating system many users/processes are allocated with computer resources in respective time slots. In this the processors time is shared with multiple users that's why it is called as time sharing o
3 min read
Difference between Batch Processing OS and Multiprogramming OS
Prerequisite - Types of Operating System 1. Batch Processing : A series of jobs are executed without any human intervention in Batch processing system. In this set of jobs with similar needs are batched together and inputted to the computer for execution. It is also called as Simple Batch System. It is slower in processing than Multiprogramming sys
3 min read
Difference between Multiprocessing and Multiprogramming
Multiprocessing is a system that has two or more than one processors. In this, CPUs are added for increasing the computing speed of the system. Because of Multiprocessing, there are many processes that are executed simultaneously. Multiprocessing is further classified into two categories: Symmetric Multiprocessing, Asymmetric Multiprocessing. Insym
2 min read
System Protection in Operating System
Introduction: System protection in an operating system refers to the mechanisms implemented by the operating system to ensure the security and integrity of the system. System protection involves various techniques to prevent unauthorized access, misuse, or modification of the operating system and its resources. There are several ways in which an op
3 min read
User View Vs Hardware View Vs System View of Operating System
User View of Operating System: The Operating System is an interface, hides the details which must be performed and present a virtual machine to the user that makes it easier to use. Operating System provides the following services to the user. Execution of a programAccess to I/O devicesControlled access to filesError detection (Hardware failures, a
1 min read
File System Implementation in Operating System
Prerequisite - File Systems in Operating Systems A file is a collection of related information. The file system resides on secondary storage and provides efficient and convenient access to the disk by allowing data to be stored, located, and retrieved. File system implementation in an operating system refers to how the file system manages the stora
11 min read
Xv6 Operating System -adding a new system call
Prerequisite - Xv6 Operating System -add a user program In last post we got to know how to add user program in Xv6 Operating System. Now here you will see how to add new system call in Xv6 Operating System. A dding new system call to xv6: A system call is way for programs to interact with operating system. A computer program makes system call when
6 min read
Article Tags :