Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start executable with realtime priority?

So I try this on windows 8.1:

start /low cmd

And I get cmd process with low priority. But when I do:

start /realtime cmd

I get new cmd process with high priority.

Is there a way to get realtime without setting it manually? Also, can I somehow set desired priority from the code of my application, maybe WinApi or something?

like image 826
Kriattiffer Avatar asked Mar 15 '16 11:03

Kriattiffer


People also ask

How do I run a program in real-time priority?

Select Task Manager's Details tab. Then right-click the EXE process for the software you just started to select Set priority. Choose a Realtime, High, Above Normal, Normal, Below Normal, or Low option on the Set priority menu.

Can I set game priority to realtime?

It is safe to run games in real-time priority, in that you won't break your computer or ruin anything in the process. With modern computers, you're unlikely to even have unintended negative side effects. But, with older machines and specific modern setups, this could cause the computer to run slowly or crash.

What happens if you set priority to realtime?

Real-time is the highest priority class available to a process. Therefore, it is different from 'High' in that it's one step greater, and 'Above Normal' in that it's two steps greater. Similarly, real-time is also a thread priority level.

How do you change the priority of a running process?

You can change the scheduling priority of a running process to a value lower or higher than the base scheduling priority by using the renice command from the command line. This command changes the nice value of a process.


1 Answers

It works when you are executing start as an administrator.

Technically, you need the SeIncreaseBasePriorityPrivilege, which an administrator normally has. If you don't, it looks like albeit I couldn't find any documentation about that fact, that you are silently reverted to a priority that is still viable with the calling account.

I doubt that Win32 will help, as the same restrictions surely apply.

like image 196
Christian.K Avatar answered Sep 22 '22 08:09

Christian.K