Difference Between Multiprogramming and Multitasking



Both multiprogramming and multitasking are the concepts related to the operating systems of computer. It is not a good practice that keeping the CPU occupied for a single task only. Since, there is a considerable difference between the speeds of the CPU and other components of the computer system. This difference increases the CPU idle time and degrades its throughput. Therefore, to overcome this problem, several concepts such as multiprogramming, multitasking, multithreading, etc. have been developed to improve the CPU utilization.

In this article, we will discuss the important differences between multiprogramming and multitasking. Let's start with some basics of multiprogramming and multitasking so that it becomes easier to understand how they are different from each other.

What is Multiprogramming?

The concurrent residency of more than one program in the main memory is called as multiprogramming. Multiprogramming organizes the jobs to increase the CPU utilization. The jobs are organized in such a way that the CPU always has a job to execute. In multiprogramming, multiple jobs are kept in the main memory. The concept of multiprogramming allows the operating system to run several programs on a single CPU machine.

When a single job has to wait for occupying I/O units, another jobs are always ready to utilize the CPU. In this way, multiple jobs can share the CPU concurrently. Although, the multiprogramming does not define that the jobs would be executed simultaneously. Therefore, multiprogramming increases the CPU utilization, reduces the response time, and assigns priority to the jobs.

What is Multitasking?

The execution of more than one task simultaneously is called as multitasking. In multitasking, the CPU is assigned to a process for a specified duration (called time slice), after this time period, the CPU is switched to another process. In this way, multitasking allows to run various programs simultaneously. The multitasking is a highly complex concept of operating system which is developed on the principle of time slice. In this concept, a fixed period of time is assigned to each job to be completed.

Common examples of multitasking include: typing in a document while the printing process is running, listening musing while browsing internet, etc. It seems that all of the tasks are running at the same time, but it is not true. In these cases, the CPU shifts among these tasks at such a fast speed that we believe they are running simultaneously.

Difference between Multiprogramming and Multitasking

The following table highlights the important differences between multiprogramming and multitasking −

Parameter Multiprogramming Multitasking
What it is? The concurrent residency of more than one program in the main memory is called as multiprogramming The execution of more than one task simultaneously is called as multitasking.
Purpose Multiprogramming is useful in reducing the CPU idle time and it improves the throughput. Multitasking is used to execute several task at once to boost the CPU throughput.
Number of CPU In multiprogramming, only one CPU is required to the tasks. In multitasking, multiple CPUs are needed to accomplish the task.
Job processing time Multiprogramming requires more time to process the jobs Multitasking requires moderate amount of time.
Number of process being executed One process is executed at a time. Once the process is completed, the system suspends that process and select a new process to execute. In multitasking, multiple jobs can run concurrently, and the CPU is assigned to a certain job for a fixed duration of time.
Number of users One at a time. More than one
Throughput Throughput is less. Throughput is moderate.
Efficiency Less Moderate
Categories No further divisions Single User & Multiuser.
CPU switching In multiprogramming, the CPU switches between processes swiftly. In multitasking, the CPU switches among the processes of several programs.
Mechanism Multiprogramming uses the context switching mechanism. Multitasking uses the timesharing mechanism.

Conclusion

The most significant difference between multiprogramming and multitasking is that multiprogramming allows the multiple programs to use the CPU at the same time, whereas multitasking allows numerous programs to execute simultaneously.


Advertisements