Executing several tasks simultaneously is called ‘Multitasking’, There are 2 types of multitasking.
1. Process based Multitasking
Executing several tasks simultaneously where each task is a separate independent process is called ‘Process based Multitasking’.
While writing java program in the editor we can run MP3 player. At the same time we can download a file from the net. All these tasks are executing simultaneously and independent of each other. Hence it is process based Multitasking. Process based Multitasking is best suitable at O.S level.
2. Thread based Multitasking
Executing several tasks simultaneously where each task is a separate independent part of the same program is called ‘Thread based Multitasking’. This type of multitasking is best suitable at programmatic level.
Java provides in built support for thread based multitasking by providing rich library (Thread, ThreadGroup, Runnable ..etc)
Whether it is Processbased or Threadbased the main objective of multitasking is to reduce response time and improve performance of the system. The main application area of multithreading is videogames implementation, Multimedia graphics , to develop animations etc.