
- Operating System Tutorial
- OS - Home
- OS - Overview
- OS - Components
- OS - Types
- OS - Services
- OS - Properties
- OS - Processes
- OS - Process Scheduling
- OS - Scheduling algorithms
- OS - Multi-threading
- OS - Memory Management
- OS - Virtual Memory
- OS - I/O Hardware
- OS - I/O Software
- OS - File System
- OS - Security
- OS - Linux
- OS - Exams Questions with Answers
- OS - Exams Questions with Answers
- Operating System Useful Resources
- OS - Quick Guide
- OS - Useful Resources
- OS - Discussion
What's the difference between a context switch, a process switch and a thread switch in Linux?
Context Switching involves storing the context or state of a process or thread so that it can be reloaded when required and execution can be
resumed from the same point as earlier. This is a feature of a multitasking operating system and allows a single CPU to be shared by multiple processes.
A process switch or process scheduling is to changing one process from another by saving all of the state of the currently executing process, including its register state, associated kernel state, and all of its virtual memory configuration.
A thread switch means switching from one thread to another thread within a process.
The main difference between process switch and thread switch is that virtual address space is remaining same and thus have same content in the cache is case of thread switch.so there is no need to invalidate the TLB. But this is not happened in case of process switch as virtual address space is not remain same. So we must invalidate the TLB cache.
Thus the cost for switching between processes is much more than switching between threads.
- Related Articles
- Differentiate between process switch and mode switch in OS
- Difference between One-Way Switch and Two-Way Switch
- Difference between a Managed and an Unmanaged Switch
- Difference between Router and Switch
- Difference between Hub and Switch
- Difference between Gateway and Switch
- Actions taken by a kernel to context-switch between processes
- How can kernels context-switch between processes?
- Difference Between if-else and switch
- What is a switch?
- Actions taken by a kernel to context-switch between kernel-level threads.
- Transistor as a Switch
- Difference between take over and Switch ownership in SAP HANA
- What is difference between using if/else and switch-case in C#?
- Choose the incorrect statement.$(a)$. A switch is the source of electric current in a circuit.$(b)$. A switch helps to complete or break the circuit.$(c)$. A switch helps us to use electricity as per our requirement.$(d)$. When the switch is open there is an air gap between its terminals.
