Multiprogramming Operating System
A Multiprogramming Operating System runs multiple programs on a single processor. If a program has to wait for an I/O operation, other programs utilize the CPU in the meantime. These operating systems form an important and popular class of operating systems. Some examples are Linux distributions, Windows, IOS, etc.
To understand this topic, you should have some knowledge of the following Operating System topics:
What is a Multiprogramming Operating System?
An operating system that is capable of running multiple programs on a single processor is known as a multiprogramming operating system. If a program has to wait for an I/O transfer in a multiprogramming operating system, other programs utilize the CPU and other resources.
One of the major aims of multiprogramming is to manage the various resources of the entire system. Multiprogramming is the principle concept used by multiprogramming systems. These resources include but are not restricted to, the file system, memory, processors, input and output, etc.
Multiprogramming operating systems, therefore, are designed for storing and processing several programs simultaneously (not necessarily in real-time, though; explained below). The routines responsible for managing resources are made accessible to the core functions of the operating system.
Examples of Multiprogramming Operating System
- Desktop operating systems, such as Linux distributions, Windows, macOS`, etc. These are modern operating systems and incorporate various multiprogramming concepts in their functioning. A user is able to run multiple jobs on a system running one of these (or more) operating systems at the same time. Many games have been designed to use a single processor core, for instance.
- On Android, iOS, and other mobile operating systems on the phone, one can listen to music while also sending and receiving text messages.
- Application software, such as Office, popular web browsers, `media players, etc. Any modern web browser would let a user visit multiple websites at the same time by opening as many windows/tabs as required.
Types of Multiprogramming Operating System
Following are the 2 kinds of multiprogramming operating systems:
- Multitasking Operating System
- Multiuser Operating System
1. Multitasking Operating System
A multitasking operating system is capable of executing several programs simultaneously. The operating system achieves this by swapping each program in and out of memory, one at a time. When a program is brought out of memory, it is saved for a while on secondary memory until it is needed again.
2. Multiuser Operating System
A multi-user operating system enables several users to share processing time on one powerful central computer through different terminals. The operating system achieves this by quickly switching among different terminals.
Each of these terminals receives a limited amount of processor time on the powerful core computer. The operating system switches among these terminals so rapidly that each user would seem to be having consistent access to the powerful core computer.
Working on Multiprogramming Operating System
Multiprogramming is the interleaved execution of many tasks on one computer system. In multiprogramming operating systems, while a program waits for some I/O operating to finish, some other program uses the CPU for that time being. It's, therefore, possible for many tasks to share the CPU time.
It should be noted that multiprogramming does not imply the execution of multiple processes simultaneously.
What it does mean is that there are a number of tasks that can use the resources such as CPU, memory, etc. A segment of one process will be executed, followed by a part of another, and so on.
No two processes will ever actually be allowed to utilize a common resource such as the processor at the same time. Yet, the mechanism of accessing these resources is not even similar to sequential/serial. In the sequential method, one program would be assigned the CPU. Once this job has completed execution, the CPU will be assigned to another job, and so on, that is, in a serial fashion.
Multiprogramming allows for more efficient resource utilization by introducing a number of concepts such as preemption, prioritizing, scheduling, etc. A program, simply put, does not have to wait for the process that currently is utilizing the CPU, to execute to completion.
Advantages of Multiprogramming Operating System
- The processor is utilized most of the time and rarely becomes idle unless there are no jobs to execute.
- The system is fast because all the jobs run parallel amongst themselves.
- Jobs that would require CPU for a short duration are finished earlier in comparison to those with long CPU requirement time.
- Multiprogramming OS supports multiple users on the computer system.
- Resources utilization is efficient and even.
- Total time required to execute a job reduced.
- Multiprogramming OS is good at dealing with applications in which multiple jobs are to be executed.
Disadvantages of Multiprogramming Operating System
- Sometimes, processes requiring long CPU times have to wait for other jobs (usually relatively shorter jobs) to finish.
- It's not easy to keep track of a large number of processes in multiprogramming.
- Multiprogramming OS is not an easy job owing to the complex nature of schedule handling.
- Multiprogramming OS has to use CPU scheduling.
- Memory management should be very efficient.
- While a program executes, there cannot be any interaction between it and the user.
- An operating system that is capable of running multiple programs on a single processor is known as a multiprogramming operating system.
- If a program has to wait for an I/O transfer in a multiprogramming OS, other programs utilize the CPU and other resources.
- Multiprogramming means interleaved execution of several tasks on the same computer system.
- One of the major aims of multiprogramming is to manage the various resources of the entire system.
- Examples of multiprogramming OS are Windows, IOS, Excel, Firefox, etc.