• 注意!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
  • 相关阅读:
    原创:vsphere概念深入系列二:vSphere交换机命令行查看排错
    原创:vsphere概念深入系列一:关于vsphere虚拟交换机的端口的数量限制。
    SQL Server 2012安装step by step
    iCloud无法导入vCard问题。fix the error when import vcard/vcf to icloud.
    微软补丁安装工具wusa报错。
    windows server 2012 浏览器IE10无法下载。
    VMware vSphere ESX* 5.x iSCSI Boot with VLAN Support: Guide
    How to configure ESXi to boot via Software iSCSI?
    光纤通道
    不错的介绍:存储基础知识。
  • 原文地址:https://www.cnblogs.com/zero5/p/3604032.html
Copyright © 2020-2023  润新知