Thread vs Process
- Thread is the subset of Process. A process can contain many threads in it.
- Thread share the memory address space & other resources which are allotted to the process by Kernel.
- Thread will share file descriptor
- The thread will share file system context.
- Thread will share Signal handling
- Most Processes will not share file descriptor
- Processes will not share file system context.
- Processes will not share Signal handling
- A Thread can directly communicate with other thread. A Process can communicate with other process using Inter Process Communication mechanism (IPC). Thread communication considerably simple & easy than Process communication. (Socket, Pipe, Message Queue, Shared Memory are the example of IPC)
- We can say thread have no overhead while process have considerable overhead.
- A thread can have control over other thread of the same process while the process can control its child process.
- A Change to the main thread can affect the other thread while change to parent process can not affect the child process.
- A thread can be considered as light weighted Process or component.
0 comments :
Post a Comment