What is the 'realtime' process priority setting for?

后端 未结 7 1826
挽巷
挽巷 2020-12-08 06:20

From what I\'ve read in the past, you\'re encouraged not to change the priority of your Windows applications programmatically, and if you do, you should never change them to

7条回答
  •  我在风中等你
    2020-12-08 06:36

    Simply, the "Real Time" priority class is higher than "High" priority class. I don't think there's much more to it than that. Oh yeah - you have to have the SeIncreaseBasePriorityPrivilege to put a thread into the Real Time class.

    Windows will sometimes boost the priority of a thread for various reasons, but it won't boost the priority of a thread into another priority class. It also won't boost the priority of threads in the real-time priority class. So a High priority thread won't get any automatic temporary boost into the Real Time priority class.

    Russinovich's "Inside Windows" chapter on how Windows handles priorities is a great resource for learning how this works:

    • http://web.archive.org/web/20140909124652/http://download.microsoft.com/download/5/b/3/5b38800c-ba6e-4023-9078-6e9ce2383e65/C06X1116607.pdf

    Note that there's absolutely no problem with a thread having a Real-time priority on a normal Windows system - they aren't necessarily for special processes running on dedicatd machines. I imagine that multimedia drivers and/or processes might need threads with a real-time priority. However, such a thread should not require much CPU - it should be blocking most of the time in order for normal system events to get processing.

提交回复
热议问题