Thursday, August 15, 2013

What is Multitasking ?

Multitasking is the ability to perform more than one activity concurrently on a computer. We can further break multitasking into process based and thread based .

Process-based Multitasking 
Process-based multitasking allows processes ( or programs ) to run concurrently on a computer. For example , running different applications at the same time like downloading a file and printing a file .

A process has a self-contained execution environment. A process has a complete , private set of basic resources . Each process has its own memory space.

Thread-based Multitasking
Thread-based multitasking allows different parts of the same process ( program ) to run concurrently .
A good example is printing and formatting text in a word processor at the same time.
Thread-based multitasking is only feasible if the two parts are independent of each other or more precisely they are independent paths of execution at run time.

Threads are also referred as lightweight processes and they also provide an execution environment . Threads exists within a processes and share its resources like memory and open files.

We have several advantages of Thread-based multitasking over Process-based multitasking .

1. Threads shares the same address space.

2. Context switching between the threads is less expensive than in Processes.

No comments :

Post a Comment