Home »
Operating System
Multiprogramming and Multiprocessing in Operating System
In this tutorial, we will learn about the multiprogramming operating system and multiprocessing operating system. We also comprise differences, advantages and drawbacks of multiprogramming and multiprocessing operating system.
By Monika Jha Last updated : May 05, 2023
What is Multiprogramming Operating System?
To overcome the problem of underutilization of CPU and RAM, the concept of multiprogramming was introduced.
"In a multiprogramming system, two or more processes execute one after another or more different independent programs by the same computer system."
Working of Multiprogramming System
- In this concept, two or more user programs can be in main memory and can be executed concurrently. The CPU can give time to various programs despite sitting idle when one is busy with I/O operations.
- When one program is waiting for I/O transfer there is next program ready to utilize the processor. Therefore, several processes can share the time of the CPU.
- Execution of jobs at the same instance of time is not referred to as multiprogramming but it is defined as the number of jobs available to the processor (placed in main memory) and a portion of another process is executed then a segment of another and so on.
A process of multiprogramming is shown in figure:
Why use Multiprogramming OS?
- Increased Throughput - Throughput is increased by utilizing the idle time of the CPU by running other programs also that are already available in the main memory.
- Lowered Response Time - Response Time is lowered by identifying the priority of a job as it enters in the system and by executing jobs on behalf of their priority.
Drawbacks of Multiprogramming OS
- User cannot interact with any program while that is in execution. So, we have to perform offline debugging.
- CPU scheduling and memory management are required.
What is Multiprocessing Operating System?
These types operating system has multiple processors within a single Computer system which shares their bus, clock, memory and input/output devices. By using Input/ Output processors enhance the efficiency of the computer system and it makes possible the concurrent execution of input, processing and output operations.
Basic Organization of a typical Multiprocessing System
Working of Multiprocessing System
- In multiprocessing systems, many processes can be executed simultaneously. Say processes P1, P2, P3, and P4 are waiting for their execution. In the uni-processor system, one process will execute, then the next one, then the other and so on.
- In multiprocessing, each process can be allocated to a different processor for its execution. If its a dual-core processor (2 processors), two processes can be executed simultaneously and thus it will be two times faster, similarly a quad-core processor(4 processors) will be four times as fast as a single processor.
- In some systems, various small CPUs are connected to perform the main processing. If one of the small CPUs fails, the other CPUs will automatically start executing its job. In other systems, CPUs are connected as a computer network.
Drawbacks of Multiprocessing OS
- By permitting parallel processing of different portions of programs, enhances the performance of the computer systems.
- In addition to the CPUs, it also facilitates the more effective utilization of other devices that saves money.
- Multiprocessing provides the facility of built-in backup. If one of the CPUs breaks down, the other CPUs automatically controls the complete workload until repairs are made. Thus, a complete breakdown of such a system is very rare, so that reliability of system increase.
Drawbacks of Multiprocessing OS
- A good performance OS required to schedule, balance and coordinate the input, output and processing activities of multiple CPUs. To build such type of OS it requires a large amount of time and highly powered computer working people.
- It is very expensive.
- The main memory of bigger size is required for holding the special OS along with various users programs.
Difference between Multi programming and Multi processing OS
The following are the main differences between Multi programming and Multi processing operating system:
- Multiprogramming is interleaved execution of two or more process by a single CPU computer system. Whereas, Multiprocessing is the simultaneous execution of two or more process by a computer having more than one CPU.
- Multiprogramming occurs by switching from one process to others (a phenomenon called context switching) whereas, Multiprocessing occurs by means of parallel processing.
- Multiprogramming includes executing a portion of the program, then a segment of another in the consecutive time period. But in Multiprocessing it is possible for a system to simultaneously work on several program segments of one or more program.
- In Multiprogramming context switching takes place but multiprocessing permits parallel processing.