- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Actions taken by a kernel to context-switch between processes
Actions taken by a kernel to context-switch between processes are -
The OS must save the PC and user stack pointer of the currently executing process, in response to a clock interrupt and transfers control to the kernel clock interrupt handler
Saving the rest of the registers, as well as other machine state, such as the state of the floating point registers, in the process PCB is done by the clock interrupt handler.
The scheduler to determine the next process to execute is invoked the OS.
Then the state of the next process from its PCB is retrieved by OS and restores the registers. The restore operation takes the processor back to the state in which the previous process was previously interrupted, executing in user code with user-mode privileges.
Many architecture-specific operations, including flushing data and instruction caches also must be performed by Context switches.
- Related Articles
- Actions taken by a kernel to context-switch between kernel-level threads.
- How can kernels context-switch between processes?
- What's the difference between a context switch, a process switch and a thread switch in Linux?
- How can you contribute to the maintenance of the green wealth of your locality? Make a list of actions to be taken by you.
- Difference between Operating System and Kernel
- Difference Between Kernel and Operating System
- Sleep in JavaScript delay between actions?
- Difference Between Microkernel and Monolithic Kernel\n
- What is the difference between a kernel and an operating system?
- Differentiate between process switch and mode switch in OS
- Difference between One-Way Switch and Two-Way Switch
- Difference between Isothermal and Adiabatic Processes
- Difference between Router and Switch
- Difference between Hub and Switch
- Difference between Gateway and Switch
