Sunday, January 22, 2012

Difference between process and threads

In general context, Processes are completely separated from each other in each aspect such as Execution Context(CPU register contents), MMU configuration(Memory space is protected from each other by MMU protection and Virtual address space too has to be reconfigured), address space(Global variables), stack memory and other resources. So, switching between processes consumes a lot of effort such as changing the CPU context and MMU reconfiguration.
But, threads are just different execution units within a process. They just differ in the code what they execute. It means they just differ in the CPU register contents and stack. All other, MMU configuration, Global address space and all other resources are same and shared between them. So, switching between threads require only changing of CPU register contents.

No comments:

Post a Comment