Multithreading in Java

Multi threading in Java


  • A thread is a lightweight sub-process, the smallest unit of processing. 

  • Multiprocessing and multi threading, both are used to achieve multitasking.

  • Multi threading in java is a process of executing multiple threads simultaneously.

Advantages of Java Multi threading :

1) It doesn't block the user because threads are independent and you can perform multiple operations at the same time.

2) You can perform many operations together, so it saves time.

3) Threads are independent, so it doesn't affect other threads if an exception occurs in a single thread.

Comments