A thread is a lightweight subprocess. It is a separate path of execution because each thread runs in a different stack frame. A process may contain multiple threads. Threads share the process resources, but still, they execute independently.
Following are some questions asked on threads :
- What is the thread?
- Differentiate between process and thread?
- What do you understand by inter-thread communication?
- What is multithreading?