• 注意!GetThreadPriority的返回值不是系统的优先级值


    GetThreadPriority的返回值
    Return code/value Description
    THREAD_PRIORITY_ABOVE_NORMAL
    1
    Priority 1 point above the priority class.
    THREAD_PRIORITY_BELOW_NORMAL
    -1
    Priority 1 point below the priority class.
    THREAD_PRIORITY_HIGHEST
    2
    Priority 2 points above the priority class.
    THREAD_PRIORITY_IDLE
    -15
    Base priority of 1 for IDLE_PRIORITY_CLASSBELOW_NORMAL_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, ABOVE_NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASSprocesses, and a base priority of 16 forREALTIME_PRIORITY_CLASS processes.
    THREAD_PRIORITY_LOWEST
    -2
    Priority 2 points below the priority class.
    THREAD_PRIORITY_NORMAL
    0
    Normal priority for the priority class.
    THREAD_PRIORITY_TIME_CRITICAL
    15
    Base-priority level of 15 for IDLE_PRIORITY_CLASSBELOW_NORMAL_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS,ABOVE_NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASSprocesses, and a base-priority level of 31 forREALTIME_PRIORITY_CLASS processes.
      系统的优先级值
    Process priority class Thread priority level Base priority
    IDLE_PRIORITY_CLASS THREAD_PRIORITY_IDLE 1
    THREAD_PRIORITY_LOWEST 2
    THREAD_PRIORITY_BELOW_NORMAL 3
    THREAD_PRIORITY_NORMAL 4
    THREAD_PRIORITY_ABOVE_NORMAL 5
    THREAD_PRIORITY_HIGHEST 6
    THREAD_PRIORITY_TIME_CRITICAL 15
    BELOW_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_IDLE 1
    THREAD_PRIORITY_LOWEST 4
    THREAD_PRIORITY_BELOW_NORMAL 5
    THREAD_PRIORITY_NORMAL 6
    THREAD_PRIORITY_ABOVE_NORMAL 7
    THREAD_PRIORITY_HIGHEST 8
    THREAD_PRIORITY_TIME_CRITICAL 15
    NORMAL_PRIORITY_CLASS THREAD_PRIORITY_IDLE 1
    THREAD_PRIORITY_LOWEST 6
    THREAD_PRIORITY_BELOW_NORMAL 7
    THREAD_PRIORITY_NORMAL 8
    THREAD_PRIORITY_ABOVE_NORMAL 9
    THREAD_PRIORITY_HIGHEST 10
    THREAD_PRIORITY_TIME_CRITICAL 15
    ABOVE_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_IDLE 1
    THREAD_PRIORITY_LOWEST 8
    THREAD_PRIORITY_BELOW_NORMAL 9
    THREAD_PRIORITY_NORMAL 10
    THREAD_PRIORITY_ABOVE_NORMAL 11
    THREAD_PRIORITY_HIGHEST 12
    THREAD_PRIORITY_TIME_CRITICAL 15
    HIGH_PRIORITY_CLASS THREAD_PRIORITY_IDLE 1
    THREAD_PRIORITY_LOWEST 11
    THREAD_PRIORITY_BELOW_NORMAL 12
    THREAD_PRIORITY_NORMAL 13
    THREAD_PRIORITY_ABOVE_NORMAL 14
    THREAD_PRIORITY_HIGHEST 15
    THREAD_PRIORITY_TIME_CRITICAL 15
    REALTIME_PRIORITY_CLASS THREAD_PRIORITY_IDLE 16
    THREAD_PRIORITY_LOWEST 22
    THREAD_PRIORITY_BELOW_NORMAL 23
    THREAD_PRIORITY_NORMAL 24
    THREAD_PRIORITY_ABOVE_NORMAL 25
    THREAD_PRIORITY_HIGHEST 26
    THREAD_PRIORITY_TIME_CRITICAL 31
      windows核心编程 5th 184页
    Windows并没有提供返回线程优先级的函数。这一遗漏是Microsoft故意的。请记住Microsoft保留了任何时候改变调度算法的权利。我们设计的应用程序不应该了解调度算法具体细节。如果我们始终使用进程优先级类和相对线程优先级,那么我们的应用程序在现在和在操作系统的未来版本都可以运行得很好。
    参考资源: GetThreadPriority function Scheduling Priorities
  • 相关阅读:
    SkylineGlobe for web开发是否支持IE11?
    OGC标准服务 WMS WCS WFS WPS
    SkylineGlobe TerraExplorer Pro 遇到模型显示有锯齿怎么办?
    SkylineGlobe TerraExplorer Pro 7.0 Web 控件版 第一行示例代码
    Cesium3DTileset示例
    Win7 64位系统,IE11,如何让IE的Tab强制运行64位内核?
    SkylineGlobe系列软件对机器配置要求
    VS 2015 搭建Google Test
    7种排序算法的c++实现
    哈希表应用实例
  • 原文地址:https://www.cnblogs.com/zero5/p/3604032.html
Copyright © 2020-2023  润新知