Open In App

Process-Based and Thread-Based Multitasking

Improve
Improve
Like Article
Like
Save
Share
Report

Multitasking operating system is an operating system that gives you the perception of two or more tasks/jobs/processes running simultaneously. It does this by dividing system resources amongst these tasks/jobs/processes and switching between the tasks/jobs/processes while they are executing over and over again. The CPU processes only one task at a time, but in Multitasking the switching is so fast that it looks like the CPU is executing multiple processes simultaneously. They can support either preemptive multitasking, where the OS doles out time to applications (virtually all modern OSes) or cooperative multitasking, where the OS waits for the program to give back control (Windows 3.x, Mac OS 9 and earlier), leading to hangs and crashes. Also known as Timesharing, multitasking is a logical extension of multiprogramming. 

Prerequisite: Thread, Difference between multitasking, multithreading and multiprocessing 

Multitasking Programming has Two Types: 

  1. Process-based Multitasking
  2. Thread-based Multitasking

Process-Based Multitasking

Thread-Based Multitasking

In process-based multitasking, two or more processes and programs can be run concurrently. In thread-based multitasking, two or more threads can be run concurrently.
In process-based multitasking, a process or a program is the smallest unit. In thread-based multitasking, a thread is the smallest unit.
The program is a bigger unit. Thread is a smaller unit.
Process-based multitasking requires more overhead. Thread-based multitasking requires less overhead.
The process requires its own address space. Threads share the same address space.
The process to Process communication is expensive. Thread to Thread communication is not expensive.
Here, it is unable to gain access over the idle time of the CPU. It allows taking gain access over idle time taken by the CPU.
It is a comparatively heavyweight. It is comparatively lightweight.
It has a faster data rate for multi-tasking because two or more processes/programs can be run simultaneously. It has a comparatively slower data rate multi-tasking.
Example: We can listen to music and browse the internet at the same time. The processes in this example are the music player and browser.  Example: Using a browser we can navigate through the webpage and at the same time download a file. In this example, navigation is one thread, and downloading is another thread. Also in a word-processing application like MS Word, we can type text in one thread, and spell checker checks for mistakes in another thread. 

Last Updated : 09 Nov, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads