

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 Questions & Answers
- 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 to measure time taken by a function in C?
- Sleep in JavaScript delay between actions?
- How to measure the time taken by a function in Java?
- Difference between Operating System and Kernel
- Difference Between Kernel and Operating System
- Problem: Time taken by tomatoes to rot in JavaScript
- C++ code to find the area taken by boxes in a container
- Difference Between Microkernel and Monolithic Kernel\n
- Time taken by savepoint to perform backup in SAP HANA
- Differentiate between process switch and mode switch in OS
- Difference between Router and Switch
- Difference between Hub and Switch