Page 1
Wink Notes
B.Tech CSE — 5th Semester
Java Programming
— Unit - 4 —
1. Introduction to Multithreading
Multithreading is a Java feature that allows concurrent execution of two or more parts of a program for maximum utilization of CPU. Each part is called a thread.
1.1 Process vs Thread
- Process: A heavy-weight, independent program in execution (like MS Word). It has its own memory space.
- Thread: A light-weight sub-process. Multiple threads exist within the same process and share the same memory space, making context-switching between threads much faster than between processes.