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
- Multi-user operating system
- 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.
Features of Multiprogramming
- Need Single CPU for implementation.
- Context switch between process.
- Switching happens when current process undergoes waiting state.
- CPU idle time is reduced.
- High resource utilization.
- High Performance.
Disadvantages of Multiprogramming
- Prior knowledge of scheduling algorithms is required.
- If it has a large number of jobs, then long-term jobs will have to require a long wait.
- Memory management is needed in the operating system because all types of tasks are stored in the main memory.
- Using multiprogramming up to a larger extent can cause a heat-up issue.
Multitasking is a method that is divided into two types:
- 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.
- 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.
Unlock the Power of Placement Preparation!
Feeling lost in OS, DBMS, CN, SQL, and DSA chaos? Our Complete Interview Preparation
Course is the ultimate guide to conquer placements. Trusted by over 100,000+ geeks, this course is your roadmap to interview triumph.
Ready to dive in? Explore our Free Demo Content and join our Complete Interview Preparation