What is the Main Difference Between Process and Thread ?
As such both process and thread are independent sequences of execution.
The main difference is that a thread runs in a shared memory space, where as a process runs in its own memory space.
A process runs the execution in an environment provided by the operating system. A process has its own set of private resources (e.g. memory, open files, etc.).
A thread lives within a process and shares the resources likememory, open files etc. with the other threads of the same process.
This ability to share resources between different threads makes thread more suitable for tasks where performance is a significant factor.