113
Multiprogramming vs Multiprocessing vs Multitasking vs Multithreading
Multiprogramming
- “The concurrent residency of more than one program in the main memory is referred as multiprogramming.”
- Since multiple programs are resident in the memory, as soon as the currently executing program finishes its execution, the next program is dispatched for its consumption.
- Also if the currently executing program asks for input output resources then meanwhile another program is dispatched to the CPU for execution.
- The main objective of multiprogramming is:
- Maximum CPU utilization.
- Efficient management of the main memory.
- Multiprogramming can be virtually shown as:
Multiprocessing
- When one system is connected to more than one processor which collectively work for the completion of the task, it is called as multiprocessing systems.
- Multiprocessing systems can be divided in two types:
- Symmetric Multiprocessing: The operating system here resides on one processor and the other processors run user’s programs.
- Asymmetric Multiprocessing: The OS runs on any available processor or all the processor simultaneously run the user program.
- Multiprocessing systems can be virtually represented as:
Multithreading
- “Multithreading is a conceptual programming paradigm where a process is divided into a number of sub-processes called as threads. Each thread is independent and has its own path of execution with enabled inter thread communication.”
- “Thread is the path followed while executing a program. Each thread has its own program counter, stack and register.”
- A thread is a light weight process.
- It can be virtually represented as:
Multitasking
- Earlier when computers were invented, a user was allowed to submit only job or task at a time. But later with availability of high-speed processor, one can submit more than one task.
- So the capability of OS to accept more the one task per user is termed as multitasking.
- Multiple jobs are executed by the CPU simultaneously by switching between them.
- The various job can be accepted from same user or different users. There are 2 types of multitasking systems:
- Single User Multitasking
- Multi User multitasking
- It can be virtually represented as:
Now, let’s take a look at difference between these types of system:
No | Characteristic | Multiprogramming | Multiprocessing | Multithreading | Multitasking |
---|---|---|---|---|---|
1 | What it is: | The concurrent residency of more than one program in the main memory is called as multiprogramming. | The availability of more than one processor per system, which can execute several set of instructions in parallel is called as multiprocessing. | A process is divided into several different sub-processes called as threads, which has its own path of execution. This concept is called as multithreading. | The execution of more than one task simultaneously is called as multitasking. |
2 | Number of CPU: | One | More than one | Can be one or more than one | One |
3 | Job processing time: | More time is taken to process the jobs. | Less time is taken for job processing. | Moderate amount of time is taken for job processing. | Moderate amount of time. |
4 | Number of process being executed: | One process is executed at a time. | More than one process can be executed at a time | Various components of the same process are being executed at a time. | One by one job is being executed at a time. |
5 | Economical: | It is economical. | Is less economical. | Is economical. | It is economical. |
6 | Number of users: | One at a time. | Can be one or more than one. | Usually one. | More than one. |
7 | Throughput: | Throughput is less. | Throughput is maximum. | Moderate. | Throughput is moderate. |
8 | Efficiency: | Less | Maximum | Moderate | Moderate |
9 | Categories: | No further divisions | Symmetric & Asymmetric. | No further divisions. | Single User & Multiuser. |