Difference between Process and Thread:-
The difference between process and thread are given below:-
Process | Thread |
1. A process cannot share the same memory area(address space) | 1. Threads can share memory and files.
|
2. It takes more time to create a process | 2. It takes less time to create a thread. |
3. It takes more time to complete the execution and terminate. | 3. Less time to terminate.
|
4. Execution is very slow. | 4. Execution is very fast. |
5. It takes more time to switch between two processes. | 5. It takes less time to switch between two threads. |
6. System calls are required to communicate with each other | 6. System calls are not required. |
7. It requires more resources to execute. | 7. Requires fewer resources. |
8. Implementing the communication between processes is a bit more difficult. | 8. Communication between two threads are very easy to implement because threads share the memory |
9. The program is stored on disk in some file and does not require any other resources. | 9. Process holds resources such as CPU, memory, address, disk, I/O etc.
|
10. The process is an executing instance of a program. | 10. A thread is the smallest executable unit of a process. |
11. Processes have considerable overhead. | 11. Threads have almost no overhead. |
12. Processes can only exercise control over child processes. | 12. Threads can exercise considerable control over threads of the same process. |
13. Run in separate memory spaces. | 13. Run in shared memory spaces. |
Also Read:- What is a process?