36

Process Explorer is able to show the effective IO priority of a given thread, but not change it. Seeing as IO priority support is a comparatively new feature, most programs don't set their own IO priorities. It appears that by default the IO priority is derived from the thread priority (rather than process priority), which Process Explorer can't modify either.

Are there any other tools out there that can help me change the IO priority of a given thread / all threads of a given process?

quack quixote
  • 43,504
RomanSt
  • 9,959

4 Answers4

25

I developed this after seeing nobody bothered with it: https://sourceforge.net/projects/iopriority/ (open source)

This program is able to set the I/O priority of a process, and all threads are being affected by it immediately. It's pretty easy to modify it to work with threads instead of processes.

Wye
  • 259
  • 1
  • 2
  • 2
16

ProcessHacker is a GUI tool that can change IO priority of an arbitrary process.

RomanSt
  • 9,959
16

Ready-Made Tool

A third-party tool to set process I/O priorities, either by manual user action or automation and persistence, would be Process Lasso. It can set almost any process setting, and do so persistently, or by rules (e.g. when this happens, change I/O priority of that).

Programmatic Answer

The answer is a simple API call to an NT Native API, NTSetInformationProcess. It is defined as the class 'IoPriority' in the 2008 DDK. In NT6 only two levels supported: Very Low (background) and Normal. There are technically 5 levels defined -- Critical, High, Normal, Low, and Very Low. The Critical level is reserved for paging operations. No data on the others.

However, the proper way to use the I/O priority is only to start a 'background mode' via a call to the Windows API SetPriorityClass, supplying PROCESSS_MODE_BACKGROUND_BEGIN. This will cause it to use the very Low (background) I/O priority, along with an IDLE CPU priority class. When done, revert via PROCESS_MODE_BACKGROUND_END.

The SetThreadPriority API will also allow this same background mode for specific threads. Here you'd supply THREAD_MODE_BACKGROUND_BEGIN/END.

0xC0000022L
  • 7,544
  • 10
  • 54
  • 94
dyasta
  • 450
0

I'm partial to a free app called PRIO (at prnwatch.com/prio), which is a process priority saver (among other things) with a very small (less than 1 MB) footprint. After installation it runs silently in the background until you need it, and its interface builds directly into the Windows Task Manager, extending its functionality and making it as if the added features were always part of Task Manager. When you right-click a process in Task Manager with the intent of changing its priority, some of PRIO's added features become apparent, as you can change not only the process' CPU priority but its I/O priority as well (ergo your question), and you can choose to SAVE the new settings if you so desire ⁠— which is to say, make them persistent.

One thing about the I/O priority settings in particular ᎓ don't know why, but those can only go down, i.e. underneath "Normal", as both "Above normal" and "High" are always greyed out (anybody know why?). This is in contrast to CPU priority, which covers the full gamut, up to and including "Real time" (though this last is not recommended).

The app has other features that also extend the functionality of the various tabs in the Windows Task Manager. Versions exist for both 32- and 64-bit systems, and the app is free for personal use.

Mike Mounier
  • 383
  • 3
  • 7