What is the difference between Process and Threads ?

Process Threads
Process is heavy weight or resource intensive. Thread is light weight, taking lesser resources than a process.
Process switching needs interaction with operating system Thread switching does not need to interact with operating system.
In multiple processing environments, each process executes the same code but has its own memory and file resources. All threads can share same set of open files, child processes.
If one process is blocked, then no other process can execute until the first process is unblocked. While one thread is blocked and waiting, a second thread in the same task can run.
Multiple processes without using threads use more resources. Multiple threaded processes use fewer resources.
In multiple processes each process operates independently of the others. One thread can read, write or change another thread’s data.

Leave a Reply

Your email address will not be published. Required fields are marked *