What is the 'realtime' process priority setting for?

后端 未结 7 1809
挽巷
挽巷 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:43

    A realtime priority thread can never be pre-empted by timer interrupts and runs at a higher priority than any other thread in the system. As such a CPU bound realtime priority thread can totally ruin a machine.

    Creating realtime priority threads requires a privilege (SeIncreaseBasePriorityPrivilege) so it can only be done by administrative users.

    For Vista and beyond, one option for applications that do require that they run at realtime priorities is to use the Multimedia Class Scheduler Service (MMCSS) and let it manage your threads priority. The MMCSS will prevent your application from using too much CPU time so you don't have to worry about tanking the machine.

提交回复
热议问题