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.

Context Switches msdn的更多相关文章

  1. Preemption Context Switches 和 Synchronization Context Switches

    Preemption Context Switches测量操作系统任务调度线程处理器上执行的次数,以及切换到较高-priority螺纹,数. Synchronization context switc ...

  2. 【转】Context Switches上下文切换性能详解

    http://blog.csdn.net/aiai5251/article/details/50015745 Context Switches 上下文切换,有时也被称为进程切换(process swi ...

  3. context switches per second 上下文切换

    上下文切换对系统来说意味着消耗大量的CPU时间.上下文切换只发生在内核态中.内核态是CPU的一种有特权的模式,在这种模式下只有内核运行并且可以访问所有内存和其它系统资源.

  4. Context Switch Definition

    A context switch (also sometimes referred to as a process switch or a task switch) is the switching ...

  5. Context Switch and System Call

    How many Context Switches is “normal”? This depends very much on the type of application you run. If ...

  6. Linux Context , Interrupts 和 Context Switching 说明

    一. 进程Context 定义 当一个进程在执行时, CPU的所有寄存器中的值.进程的状态以及堆栈中的内容,比如各个变量和数据,包括所有的寄存器变量.进程打开的文件.内存信息等.这些信息被称为该进程的 ...

  7. CPU上下文切换的次数和时间(context switch)

    什么是CPU上下文切换? 现在linux是大多基于抢占式,CPU给每个任务一定的服务时间,当时间片轮转的时候,需要把当前状态保存下来,同时加载下一个任务,这个过程叫做上下文切换.时间片轮转的方式,使得 ...

  8. Linux Context , Interrupts 和 Context Switching 说明【转】

    转自:http://blog.csdn.net/tianlesoftware/article/details/6461207 一. 进程Context 定义 当一个进程在执行时, CPU的所有寄存器中 ...

  9. DYNAMIC CONTEXT SWITCHING BETWEEN ARCHITECTURALLY DISTINCT GRAPHICS PROCESSORS

    FIELD OF INVENTION This invention relates to computer graphics processing, and more specifically to ...

随机推荐

  1. 神马都是浮云,unity中自己写Coroutine协程源代码

    孙广东   2014.7.19 无意之间看到了,Unity维基上的一篇文章,  是关于自己写协程的介绍. 认为非常好,这样能更好的了解到协程的执行机制等特性.还是不错的. 原文链接地址例如以下: ht ...

  2. OCP-1Z0-051-题目解析-第21题

    21. Examine the description of the EMP_DETAILS table given below:  name               NULL           ...

  3. 【手势交互】8. Nimble Sense

    早在2012.2013年度,手势识别领域就发生了几起重要的行业并购.比方英特尔对Omek的收购,谷歌对Flutter的收购.而苹果公司更是以3.45亿美金得高价收购了之前为微软Kinect提供技术支持 ...

  4. 科普:google的数字图书馆

    https://books.google.com/ngrams Google Ngram Viewer,她利用google所拥有的所有图书作为资源,为你提供单词和短语历年使用次数的展示图标.数据化了数 ...

  5. javascript下获取guid或者UTC时间作为唯一值

    javascript下,有时出于需要,可以利用guid或UTC时间作为当前页面中的唯一值. 什么场景需要弄这个唯一值? 比如说,用easyUI的treegrid,添加新节点.在treegrid里面 , ...

  6. Binary safe

    https://en.wikipedia.org/wiki/Binary-safe A binary-safe function is one that treats its input as a r ...

  7. 音乐播放器之myeclipse项目

    音乐播放器: 这个音乐播放器是用myeclipse打开的项目.假设有问题记得改掉文件的路径名.还有假设图片不显示也可能是图片的路径名不正确,如音乐无法播放也可能是路径名不正确.总之这个游戏有文件的引用 ...

  8. 关于Time Series Database

    今天观察了下clojure之父datomic.com的数据库 有点类似sequence数据库的变种 不过这类数据库,感觉用在移动端会更有市场: 1. 移动端需要这种可以本地存储,无删除,联网只增加,只 ...

  9. HDU 1517:A Multiplication Game

    A Multiplication Game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Ot ...

  10. iOS 证书详解

    引言 关于开发证书配置(Certificates & Identifiers & Provisioning Profiles),相信做iOS开发的同学没少被折腾.对于一个iOS开发小白 ...