What is the difference between a process and a thread?

Syed Husen
Syed Husen

Posted On: Jan 06, 2021

 

A process is an active program under execution. Processes require more time for context switching as they are heavier. A program becomes a process at execution time. A process can create other processes which are known as Child Processes. The process has stated such as new, ready, running, waiting, terminated, suspended.

A thread is a lightweight process. Threads require less time for context switching as they are lighter than processes. Thread is the segment of a process. Processes can have multiple threads and these multiple threads are contained within a process. A thread has mainly 3 states such as running, ready, and blocked. The thread takes less time to terminate as compared to the process.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    HCL Android Developer Interview Questions

    What is Singalton design pattern?

    The Singleton Design Pattern is a Creational pattern. The main objective of the singleton class is to create only one instance of a class and to provide only one global access point to that object. Fo...

    HCL Android Developer Interview Questions

    What are Activities in Android?

    Android Activity is the subclass of ContextThemeWrapper class. An activity is a single screen with a user interface just like a window or frame of the application....

    HCL Android Developer Interview Questions

    What are Broadcast receivers in Android?

    A broadcast receiver is an Android component. It allows registering for system or application events. Once an event happens, all receivers are notified by the Android runtime....