1.multithreading
multithrading in java is a process to execute multiple threads simultaneously..
Thread is a basically lightweight process...a smallest unit of processing..multithrading,multiprocessing both are used to achieve multitasking..
why we use multithrading and multiprocessing--because threads share a common memory area not seprate memory for indivisual threads..
Lightweight processes contain a single process but multiple threads
Heavyweight processes can contain multiple subprocesses
It doesn't block the user because threads are independent and you can perform multiple operations at same time.
Multitasking
Multasking is a process to execute multiple task simultanously..we use multitasking to utilize on cpu..multitasking have two types which have to achieve..
1.Process based multitasking(multiprocess)
2.Thrad based multitasking(Multithrading)
1.Process based multitasking(multiprocess)
each process have its own addresss in memory and allocate the seprate memory to each process..
it's a heavyweight process..
2.Thrad based multitasking(Multithrading)
Threads share the same address space.
Thread is lightweight.
what is thread..
Thread is a lightweight process..it's contain in single process but multiple threads,dependent,if there occurs exception in one thread,but not effect on other thread.