Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have read that setting something to realtime is a big no-no, so I am not going to do that. But I do have an application that I need to make sure always has the highest priority on my system as it is critical for the rest of the applications I am running. Is there any danger in setting the priority to high, which is one level below realtime?

Also, how would I be able to do this by changing the shortcut target? What is the command?

share|improve this question
    
"Above normal" (windows 7) setting is safer. Some discussion here...stackoverflow.com/questions/1663993/… –  Moab Sep 17 '12 at 18:55
3  
Is this on windows? Also, you have a very low accept rate, please look over some of your older questions to see if you can accept any of the answers given. –  terdon Sep 17 '12 at 18:57
1  
It's very dangerous. The major problem is priority inversion which results in the higher-priority process actually getting an effectively lower priority because it can be indefinitely blocked by a lower priority process. –  David Schwartz Sep 17 '12 at 19:15
    
As mentioned "Realtime" is not necessarily bad so long as your process is well behaved and only runs when it needs and sleeps when it does not, otherwise it can (and will) prevent other tasks from running entirely. –  Mokubai Sep 17 '12 at 19:43
    
@David Schwartz, Cutler designed the Windows scheduler to avoid deadlock due to priority inversion. From support.microsoft.com/kb/96418, "The Windows NT scheduler solves this problem by randomly boosting the priority of threads that are ready to run (in this case the low priority lock-holders). The low priority threads run long enough to let go of their lock (exit the critical section), and the high- priority thread gets the lock back. If the low-priority thread doesn't get enough CPU time to free its lock the first time, it will get another chance on the next scheduling round ." –  Nicole Hamilton Sep 17 '12 at 20:46

3 Answers 3

up vote 3 down vote accepted

Realtime isnt necessarily a "no-no" it just might starve other processes out of CPU cycles. Some applications cant handle that. Its something you would have to experiment with.

High should be less of a problem. However, you still need to monitor your system to see if all the applications are behaving well.

Here is how to change the process via command line, which you can put into a shortcut.

http://support.microsoft.com/kb/191771

share|improve this answer
1  
On Windows, it does starve other processes very easily (including Task Manager itself). –  grawity Sep 17 '12 at 19:31
3  
It all depends on your system. Depending on how CPU intensive the process it, a realtime affinity is fine. Im running a process in realtime right now with no issues. Also, it can help to set an affinity to one processor while setting the priority to realtime. –  Keltari Sep 17 '12 at 19:35
    
If a process is set to realtime, will it be given absolute priority over all other processes on the core it's running on? I've been trying to find ways to dedicate one of my cores to Dwarf Fortress while it's running. –  SaintWacko Sep 17 '12 at 20:22

I would say it depends. If you only have one core/CPU on your computer, and it's a CPU-intensive task, I wouldn't set it to realtime. High might be okay, but that needs experimenting.

If you have multiple cores, and the process is single threaded: go ahead, set it however you want. Your other cores will still be free, even when one core is at 100% load the whole time.

If you have multiple cores and the process is multi threaded: it will depend if all threads will have 100% load. Some programs have a 'manager' thread that dispatches work to other threads but doesn't do a lot of processing itself. That would leave one core nearly free and thus allow for high or real-time priority.

Other programs will try to take in all cores. In this case high might be fine, but it needs experimenting.

Even others will only take a particular number of cores and might not use all cores available. In this case high or real-time priority should be fine.

Unless you're on a single core, go ahead, experiment. Most of the time it won't hurt to set it to high or even real-time. You can set the affinity of a process (how many cores it can use) in task manager as well. This way you can better balance the load on your CPU. It can also help keep temperatures and power consumption down, etc.

share|improve this answer
    
+1 Good point that a single-threaded app is no problem on a multi-core machine, no matter how compute-bound. –  Nicole Hamilton Sep 17 '12 at 22:11
    
Don't forget though, that as warned, [primarily] single threaded high priority processes - even if they affect only a single core - can hold global system synchronization locks for an abnormal amount of time. –  9090 Sep 18 '12 at 15:45

Whether this will work for you depends entirely on what your application does. If it's grinding through a long, long computation that never needs to wait for i/o, expect that running that at high priority could bring your machine to its knees. But if the issue is latency and your application just needs to wake up really fast in response to an i/o completion or similar event, do a little quick processing and then go right back to sleep again, it will be fine.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.