美文网首页
线程优先级

线程优先级

作者: FallMR | 来源:发表于2017-02-20 22:09 被阅读0次

    线程的优先级共有32个(0~31)由所属进程的优先级和本身的优先级所决定

    进程 ​ 线程
    REALTIME_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
    HIGH_PRIORITY_CLASS THREAD_PRIORITY_HIGHEST
    ABOVE_NORMAL_PRIORITY THREAD_PRIORITY_ABOVE_NORMAL
    NORMAL_PRIORITY THREAD_PRIORITY_NORMAL
    BELOW_NORMAL_PRIORITY THREAD_PRIORITY_BELOW_NORMAL
    IDLE_PRIORITY THREAD_PRIORITY_LOWEST
    THREAD_PRIORITY_IDLE

    然后也就没啥了= =
    给函数了

    SetPriorityClass();
    hProcess [in]
    A handle to the process.
    The handle must have the PROCESS_SET_INFORMATION access right. For more information, see Process Security and Access Rights.

    dwPriorityClass [in]
    The priority class for the process. This parameter can be one of the following values.

    SetThreadPriority();
    hThread [in]
    A handle to the thread whose priority value is to be set.
    The handle must have the THREAD_SET_INFORMATION or THREAD_SET_LIMITED_INFORMATION access right. For more information, see Thread Security and Access Rights.
    **Windows Server 2003 and Windows XP: **The handle must have the THREAD_SET_INFORMATION access right.

    nPriority [in]
    The priority value for the thread. This parameter can be one of the following values.

    相关文章

      网友评论

          本文标题:线程优先级

          本文链接:https://www.haomeiwen.com/subject/dxxywttx.html