Process:
- A process is a heavyweight process.
- A process is a separate program that has separate memory, data, resources etc.
- A process is created using fork() method.
- Context switch between the process is time-consuming.
Example:
opening any browser (Mozilla, Chrome, IE). At this point, a new process will start to execute.
opening any browser (Mozilla, Chrome, IE). At this point, a new process will start to execute.
Threads:
- Threads are lightweight processes.Threads are bundled inside the process.
- Threads have a shared memory, data, resources, files etc.
- Threads are created using clone() method.
- Context switch between the threads are not much time consuming as Process.
Example:
Opening multiple tabs in the browser.
Opening multiple tabs in the browser.
Real world example for Process and Thread This will give you the basic idea about thread and process
Comments
Post a Comment