Java Multithreading

preview_player
Показать описание
*Single tasking: Executing a single task at a time is called as single tasking. Here much of the processor time is wasted.
Ex: DOS
*Multi tasking: Executing multiple tasks at the same time is called as multitasking. Here the processor time is utilized in an optimum way. This multitasking will improve the performance by reducing the response times.
Executing several tasks simultaneously is the concept of multitasking. There are two types of multitasking's.
Ex: windows

*Time Slice: It is a small amount of processor time given to a process for execution. Multitasking is of two types. They are given below
1. Process based multitasking
2. Thread based multitasking
1. Process based multitasking: Executing different processes simultaneously at the same time which are independent of each other and every process contains its own memory. This multitasking is an operating system approach.
Ex: writing java program, down loading s/w.
Listen to music, copying s/w etc.
2.Thread based multitasking: Executing different parts of the same process simultaneously at the same time. Where those different parts have common memory, which may be dependent of independent. This multitasking is a programmatic approach.
Ex: Games, web applications
*Multithreading: Executing multiple threads at the same time is a called as multi threading or thread based multitasking.
*Thread: A separate piece of code which is executed separately is called as thread. Program to get currently executing thread information.
Рекомендации по теме
welcome to shbcf.ru