Concepts of Multitasking, Multi-programming and Multiprocessing

Filter Course


Concepts of Multitasking, Multi-programming and Multiprocessing

Published by: Zaya

Published date: 22 Jun 2021

Concepts of Multitasking, Multi-programming and Multiprocessing Photo

Multitasking, Multi-programming, and Multiprocessing

Multitasking

Both the memory and CPU time is shared among the tasks It performs multiple tasks concurrently. It gives an illusion that all the processes or tasks are performed simultaneously. For example, on your desktop, you can listen to music, download things simultaneously. The concept is that the CPU time is shared equally among the processes or tasks. Again take an example that 3 tasks are loaded into the main memory. Consider that the time allocated for each program is 5 microseconds. Now the first task is executed. After 5 microseconds irrespective of whether the task gets completed or not it gets switched to the second task. Similarly, after 5 seconds it goes to the third task. Thus the
CPU time is shared equally among the tasks.

Multi-programming

The concept of multi-programming is that more than one program that is to be executed by the processor is loaded into the memory.
Say we have 2 programs loaded into the memory. The first program that is loaded is getting executed. At one point in time, it requires input from the user or waiting for some data. During the waiting time, the CPU is idle. Instead of wasting the time, the CPU will now begin to execute the second program. Meanwhile, the first program once it receives the required data, will again get the CPU time and get executed blocking or pausing the execution of the second program. After the completion of the first program, the second program is executed from where it was paused. The concept was introduced to maximize CPU usage.

Multiprocessing

The term multiprocessing is introduced around modern times when they started to use more than one processor in a single computer (Remember the terms like dual-core, quad-core, octa-core processor). These processors share some things in common like memory, peripherals, etc. By sharing the memory and peripherals they are able to execute different tasks simultaneously.

In general,
Multi-programming: takes place in a system where it has a single processor.
Multitasking: single processor or sometimes multiprocessor
Multiprocessing: multiprocessor.