Threads Vs Process:
Here I have mentioned the basic difference between threads and process which is useful in many interviews.1)
The process is the heavy weighted component. Each Process will execute in separate address space. It will not share memory and CPU time. Separate CPU time & memory will be allocated for each process. Processes can communicate to each other via InterProcess Communication (IPC).
• Pipes
• Files
• Sockets
Thread is the light weighted component. The thread will be
2)
Context switching for a process is difficult than context switching for threads.
3)
Process is protected from other processes via MMU (Memory Management Unit)
Threads can interfere with each other.
4)
Threads can be easily created while creation of new process required duplication of parent process
5)
Threads can have control over other threads of a similar process while the process can have control over the child processes.
6)
Change to the main thread will affect the other threads of the same process. while change to parent process doesn't affect child process.
7)
Threads have direct
Concept took from & for more
www.bogotobogo.com/cplusplus/multithreaded.php
www.allinterview.com/showanswers/258.html
0 comments :
Post a Comment