October 27th, 2026
likemind blown5 reactions

Why don’t we run the taskbar and Task Manager at high priority, so they can remain responsive?

If a system becomes CPU-starved, all processes begin to suffer. This includes the taskbar and Task Manager, even though they are often the tools you want to use to stop whatever it is that’s making your system suffer. Why can’t we run the taskbar and Task Manager at high priority?

The catch with running anything at high priority is that unless you have been very careful to avoid it, you will eventually run into a shared resource that you will have to wait for, and you are now stuck. Your priority checkout pass gets you to the front of the line, but if the person at the register has a large shopping cart full of groceries, you just have to wait until they are done before you get your chance.

Even if the code that protects the shared resource is careful to avoid priority inversion by transferring the priority of the waiter to the thread that owns the resource, you are still stuck waiting, and that owning thread might be doing something that takes a long time, like, say, accessing a file over the network.

For UI code, this problem is particularly acute because you will eventually have to call into the UI system, and now you’re duking it out with all the other UI threads in the system.

The problem is that it’s hard to fix a runaway system from within that same system. The tools which you can use to try to fix the system may already have been compromised. And it’s definitely hard to fix a runaway system if your tools have to share critical resources with the thing that is out of control. Windows already gives preferential treatment to the program that is in focus, so if you can get focus onto the taskbar or Task Manager, you are doing about as well as you can. But that preferential treatment takes you only so far if those preferred threads find themselves blocked on things that are controlled by non-preferred threads.

Topics

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

11 comments

Discussion is closed. Login to edit/delete existing comments.

Sort by :
  • Frédéric B. 2 weeks ago

    I was under the impression that the Task Manager would run as High priority when started from the Ctrl+Alt+Del menu, but after verifying empirically, that’s not the case, at least not on Windows 11.

  • Shawn Van Ness

    I have a large codebase that pegs all 24 of my cores to 100% for a few minutes, when building. Explorer / taskbar is almost completely unresponsive and unusable. Even the [win+digit] hotkeys I rely on to switch windows without rendering anything .. seem to not respond well.

    I use Image File Execution Options to reduce the pri for CL.exe and MSBuild.exe .. and raise the pri of TaskMgr.exe. It helps a tiny bit, but not much.

    I'm not sure which process to blame.. explorer.exe? dwm.exe?

    Anyone have tips or tricks to keeping the...

    Read more
    • Sigge Mannen

      Maybe you can play around with msbuild/cl multithreading switches? https://stackoverflow.com/q/33787023

      • Shawn Van Ness

        Thanks -- we definitely do.. throttling that way helps limit the peak ram consumed, and reduce some context-switching, but at end of day it's still a few thousand cpp files to compile, if a shared header changes.. it's gonna take a minute. And different people on the team have different cpu's.. different ram, etc so it's hard to tune for a global minimum.

        What I've started doing, is masking off a couple cpu cores (affinity mask) to keep my PC responsive, while msbuild and cl.exe are slamming 22 of 24 cores. But there's no Image File...

        Read more
  • Guy Russo

    (I use Arch BTW)