Multitasking
Performing multiple tasks at a single time is called multitasking.
example:- A pc we can run various applications simultaneously, like when we are browsing, we can play music also.
It increases performance.
There are two ways to achieve the Multitasking
1. Process-based multitasking (Multiprocessing)
2. Thread-based multitasking (Multithreading)
Multiprocessing:
When a system a connected to multiple CPUs to complete a task is called MultiProcessing.
It is suitable for system-level or Operating System (OS) level
Multithreading :
Multiple small tasks execute simultaneously, So each small task is called a Thread.
Multithreading is suitable at the programming level.
Java provides predefined APIs(Application programming interface) for Multithreading
Below are the predefined APIs provided by java:
Thread,
Runnable,
ThreadGroup,
Concurrency,
Threadpool,
etc.
0 Comments:
Post a Comment