A method for application managed CPU context switching. The method
includes determining whether state data of a CPU is valid for a process.
The determining is performed by the process itself. If the state data of
the CPU is not valid for the process, the process accesses functional
hardware of the CPU to load new state data into the CPU. The process then
continues to execute on the CPU using the new state data. If a context
switch occurs, the existing state data of the CPU is invalidated. The
state data of the CPU can be invalidated by an operating system without
storing the state data in main memory.