Multithreading
Multithreading
S.Kavitha
Head & Assistant Professor
Department of Computer Science
Sri Sarada Niketan College of Science for
Women,Karur.
• Multithreading in java is a process of executing
multiple threads simultaneously.
• Thread is basically a lightweight sub-process, a
smallest unit of processing. Multiprocessing and
• multithreading, both are used to achieve multitasking.
• But we use multithreading than multiprocessing
because threads share a common memory area.
• They don't allocate separate memory area so saves
memory, and context-switching between the
• threads takes less time than process.
• Java Multithreading is mostly used in games,
animation etc.
Advantages of Java Multithreading
1) It doesn't block the user because threads are
independent and you can perform multiple
operations at 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 exception occur in a single
thread.
Life cycle of a Thread (Thread States)