In computing, a context switch is the process of storing the state of a process or of a thread, so that it can be restored and execution resumed from the same point later.
Switching from one process to another requires a certain amount of time for
1) doing the administration - Like Saving and loading registers and memory maps, updating various tables and lists, etc. What is actually involved in a context switch varies between these senses and between processors and operating systems.
NOTE: The scheduler doesn't see any difference between thread/process it sees them all equally as a task/job (In Linux)
2) Context switching involves switching registers, stack pointer, and program counter (PC) , (In threads these are the only things that'll be switched. And NOT the Address space!
3) Though in a process switch ( i.e context switch of a process) an address space switch also happens
4) Finally, Context switching itself has a cost in performance, due to running the task scheduler, TLB flushes, and indirectly due to sharing the CPU cache between multiple tasks.
5) However Switching between threads of a single process can be faster than between two separate processes, because threads share the same virtual memory maps, so a TLB flush is not necessary.