zoukankan      html  css  js  c++  java
  • Context Switches msdn

    Context Switches

     https://msdn.microsoft.com/en-us/library/ms682105(VS.85).aspx

    The scheduler maintains a queue of executable threads for each priority level. These are known as ready threads. When a processor becomes available, the system performs a context switch. The steps in a context switch are:

    1. Save the context of the thread that just finished executing.
    2. Place the thread that just finished executing at the end of the queue for its priority.
    3. Find the highest priority queue that contains ready threads.
    4. Remove the thread at the head of the queue, load its context, and execute it.

    The following classes of threads are not ready threads.

    • Threads created with the CREATE_SUSPENDED flag
    • Threads halted during execution with the SuspendThread or SwitchToThread function
    • Threads waiting for a synchronization object or input.

    Until threads that are suspended or blocked become ready to run, the scheduler does not allocate any processor time to them, regardless of their priority.

    The most common reasons for a context switch are:

    • The time slice has elapsed.
    • A thread with a higher priority has become ready to run.
    • A running thread needs to wait.

    When a running thread needs to wait, it relinquishes the remainder of its time slice.

  • 相关阅读:
    QT 界面刷新
    剑指 Offer 65. 不用加减乘除做加法
    3.nvidia-docker安装
    6.通过docker配置深度学习环境
    2.docker安装
    OSG+Visual Studio2015项目变量设置;
    Learning OSG programing---osgwindows
    日常学习网站推荐
    开发 MFC 应用的一般过程
    FVWM使用指南
  • 原文地址:https://www.cnblogs.com/feng9exe/p/7891516.html
Copyright © 2011-2022 走看看