Overview about context switches

Terminology

Thread switch: Changes from one thread of execution to another.
• Does not require a change of protection domain.
• Continue running in the same address space.
• Can change threads in user mode or in supervisor mode.
Domain crossing: Changes the privilege at which the processor is executing.
• Can change from user to supervisor.
• Can change from supervisor to user.
• Requires a trap or return from trap.
• Requires an address space change (either user to kernel or kernel to user)
Process switch: Changes from execution in one (user) process to execution in another (user) process.
• Requires two domain crossings + a thread switch in the kernel.
Context switch: usage varies
• Sometimes used for either thread or process switch.
• Sometimes used to mean only process switch.
• Every once in a while used to mean domain crossing.

How long does it take to make a context switch?

Reference

Leave a Reply

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