Professional Researcher's Encyclopaedia

Knowledge is only a click away

Context switch - enyclopaedia article

Context switch

Summary: A context switch is the computing process of storing and restoring the state of a CPU (the context) such that multiple processes can share a single CPU resource. The context switch is an essential feature of a multitasking operating system. Context switches are usually computationally intensive and much of the design of operating systems is to optimize the use of context switches. Context switches usually involve the following steps, assuming process P1 is running on the CPU and process P2 is ...

read the full Context switch article

Buy Context switch related products:


Buy from Amazon.co.uk Books - Music - Classical - VHS - DVD - Video-games - Software - Electronics - Toys
Buy from Amazon.com Books - Music - Classical - VHS - DVD - Videogames - Software - Electronics - Photo - Toys
Buy from Amazon.ca Books - Music - Classical - VHS - DVD - Video-games - Software - Livres en Français
Buy from Amazon.de - - - - - - -
Buy from Amazon.fr - - - - -
Advanced Product Search (new):    uk    |     us    |     ca    |     de    |     fr

Context switch

     From Wikipedia, the free encyclopedia.

A context switch is the computing process of storing and restoring the state of a CPU (the context) such that multiple processes can share a single CPU resource. The context switch is an essential feature of a multitasking operating system. Context switches are usually computationally intensive and much of the design of operating systems is to optimize the use of context switches.

Context switches usually involve the following steps, assuming process P1 is running on the CPU and process P2 is the next process to run on the CPU:

  • Store the context of P1 somewhere in memory (usually on the stack of P1). The context of the CPU will contain the value of registers such as the program counter, processor control and general purpose registers.
  • Retrieve the context of P2 from memory (usually on the stack of P2).
  • Return to the location contained in the program counter (the line of code at which the original process was interrupted).
Some CPUs contain logic to allow several hardware contexts to simultaneously exist, eliminating the need to store and restore the CPU context to memory on context switch.

link to this article with the following HTML

 
This article is from Wikipedia. This article was up-to-date as of 8 May 2004 - See live article
All text is available under the terms of the GNU Free Documentation License.

This page is part of Professional Researcher
Web site design by Dean Marshall