linux进程管理之上下文切换(context switching)

 

关键词:linux进程管理 上下文切换

During process execution, information on the running process is stored in registers on theprocessor and its cache. The set of data that is loaded to the register for the executingprocess is called the context. To switch processes, the context of the running process isstored and the context of the next running process is restored to the register. The processdescriptor and the area called kernel mode stack are used to store the context. This switchingprocess is called context switching. Having too much context switching is undesirable because the processor has to flush its register and cache every time to make room for the new process. It could cause performance problems.

Fig. linux context switching

linux进程管理 上下文切换_第1张图片