Multiprogramming Operating System
- Multiprogramming operating system allows multiple users to execute multiple programs using a single CPU concurrently i.e. at the same time.
- In multiprogramming several processes are kept in the main memory and CPU execute all these processes concurrently. It means, the CPU immediately switches from one process to next that are ready to get executed.
- Such a system is possible by having a mixture of CPU bound processes (i.e. the processes that mostly perform numerical calculation with little I/0 operations. Their CPU utilization is high) and I/O bound processes (i.e. the processes that perform very little computations and most of the time they perform I/O operations. Their CPU utilization is very low.)
- In such an operating system when one process start performing I/O operations, the CPU is allocated to another user process in the main memory that is ready to use the CPU. Thus CPU never remains idle and is always kept busy executing some processes.
- Multiprogramming does not mean that CPU executes the instructions from several programs at the same time. Rather, it means that there are number of programs available to CPU and that a portion of one is executed, then a segment of another and so on.
- Although two or more users programs reside in the main memory simultaneously, the CPU is capable of executing only one instruction at a time. Hence, at any given time, only one of the programs has control of CPU and is executing instructions. Simultaneous execution of more than one program with single CPU is impossible.
Multitasking Operating System
- Technically, multitasking is same as multiprogramming.
- In a multitasking operating system, a single user can execute multiple programs at the same time.
- We can also say, multitasking is the system’s capability to work on more than one job or process at the same time. It means that whenever a job needs to perform I/O operations, the CPU can be used for executing some other job or process that is also residing in the system and is ready to use the CPU.
- The term multiprogramming is used for multi-user systems i.e., systems that are simultaneously used by many users such as mainframe and server class system and the term multitasking is used for single user system i.e., systems that are used by only one user at a time such as a personal computer or a notebook computer.
- Thus multitasking is the method of processing the multiple tasks concurrently in a single user system. For example, a user is running separate program in four different windows at the same time. The program in window1 could be printing a document, the program in window 2 could be displaying an e-mail of user, a spreadsheet program in window 3 could be preparing sales report and compilation of a program is in progress in window 4. In this manner, a user may work on many tasks at the same time. Thus, progress of different tasks can be viewed on different windows in a multitasking system.
Difference between Multiprogramming and Multitasking
Parameters | Multiprogramming | Multitasking |
Meaning | It is used for multi-user systems i.e., the systems that are used by many users at the same time. | It is used for single user systems i.e., the systems that are used by only one user at a time. |
Speed | It refers to the concurrent execution of multiple jobs that may be of same user or different users. | It refers to the concurrent execution of multiple jobs of a same user. |
Time | Multiprogramming takes more time to execute any program to process | Multitasking takes less time to execute any task or program process. |
Objective | The multiprogramming objective is to improve the utilization of the CPU. | The multitasking objective is to improve the timing of the response. |