Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the 'realtime' process priority setting for?

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 'Realtime'.

What does the 'Realtime' process priority setting do, compared to 'High', and 'Above Normal'?The process priority list, ranging from Low to Realtime.

like image 633
Chris S Avatar asked Nov 02 '09 21:11

Chris S


People also ask

Should I set my game priority to realtime?

Unless you are running another program at the same time as the game (e.g. downloading a file in the background), setting the priority in this way will have absolutely no effect on the gaming performance. Priorities are just relative to other running tasks.

What is set priority realtime in Task Manager?

Realtime priority means that any input the process sends will be processed in real time as far as possible, sacrificing everything else to do so. Since 16>15, it will prioritise running that game's internal processes over anything including your inputs.


2 Answers

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.

like image 101
ReinstateMonica Larry Osterman Avatar answered Sep 18 '22 00:09

ReinstateMonica Larry Osterman


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.

like image 20
Michael Burr Avatar answered Sep 21 '22 00:09

Michael Burr