Limit The CPU Usage Of Misbehaving Programs With ThreadMaster

When my browser (Chrome, in this instance) gets its hands on a particularly meaty Flash object, the Shockwave plugin responsible goes absolutely haywire trying to render the thing at the fastest possible speed. Which is a good thing, I suppose, except when it completely dominates the CPU and causes my notebook's temps to sore into the 70°C range. Thankfully, there's a way to keep hyperactive threads under control.

ThreadMaster is an installable service for Windows 2000 and higher operating systems that monitors threads and, if they exceed a certain CPU utilisation threshold, throttles their usage to more sane levels. It's not the easiest program to install -- it requires tinkering in the Registry -- but once it's configured, you can just leave it to do its thing.

Firstly, download extract the program to a convenient folder. On Windows 7, the program failed to run correctly when installed to the default directory, so you'll need to edit "Install.cmd" in your favourite text editor and replace the value for "zInstDir" on the fourth line with "C:\ThreadMaster" (or somewhere else, such as "Program Files"). Save it and run the "Install.cmd" file. This will copy the program to the directory we just specified and add it as a service (off by default) with its start-up mode set to "Automatic". Before you activate it, you'll need to crack open the Registry by running Regedit and head to the following entry:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ThreadMaster\Parameters]

Look for the value called "CPUThresholdPct" and set it to "100". This means that throttling will only occur when a thread exceeds 100 per cent utilisation -- or never, as you may have deduced. It's a global setting, and unless you want the clamping to affect every program, it's best to use ThreadMaster's "blacklist" functionality to target specific programs, such as Chrome or Firefox.

You'll then want to set the MainSampleTime to "10", the lowest possible value. ThreadMaster will wait until a program has exceeded its threshold for X or more seconds before stepping in, where X is the value you've specified here.

Under "Parameters", you'll find a sub-key called "Applications". This is where we add programs we want ThreadMaster to control. Simply add the image/executable name as a "string" or text entry, minus the path. So, if you wanted to add Chrome, you'd type in "chrome.exe".

For the entry's value, put in the percentage threshold that will trigger ThreadMaster. Depending on how powerful your CPU is, this value should be between 5-20 per cent. For my 2.4GHz Dell M1330, I found 10 to be about right. The easiest way is to watch the CPU usage in Task Manager while the program in question is under load.

With these settings configured, you can close the Registry and start the service. This can be done quickly by opening Task Manager, selecting the "Services" tab, and clicking the "Services..." button at the bottom of the window. Find "Thread Master" in the list of services, right-click it and hit "Start". Because it's set to "Automatic" it'll run whenever Windows is loaded.

That's all there is to it. The program is easy enough to test -- I wrote a small C# app that just loops continuously, hogging all the CPU time of one core of my Core 2 Duo processor. After 11 seconds, its usage plummeted from 48-50 per cent to 8-10 per cent as ThreadMaster brought it under control. In general usage, it kept my CPU temps at 60° while playing several YouTube videos in Chrome, down 10°C. Give it a go and tell us your results.

ThreadMaster [Official site]


Comments

    "...causes my notebook’s temps to sore into the 70°C range."

    Did you mean "soar" instead of "sore"?

    Sore: physically painful or sensitive, as a wound, hurt, or diseased part: a sore arm.

    Soar: to fly upward, as a bird.

    "sore"? Is this a poetic reference to the state of the lap that your laptop is sitting on or did you mean soar?

    What, you mean Chrome's multi-process, high memory usage version of 'speed' isn't faultless? Amazing ... and here's everyone bagging Firefox's performance (though with good reason! :) )

      @pd Thats is too funny. I bet Logan (the guy who wroye this article) bagged out Firefox for exactly the same thing. Now he has the same problem in Chrome. :) :)
      See kids.....Chrome is no better than the alternatives currently out there (namely Firefox).
      BTW......I'm running 8 cores and although I still have that problem (you cant get around it) The rest of my system is unaffected. Meaning the other cores take over nicely.
      Trust me Logan after many months of your CPU's power being pulled down too much when it works too hard, you'll proberbly consider disabling threadmaster as it you'll find processes take too long to complete and you know you CPU is more capable. I have been experimenting with CPU throttling on and off over the past 12 years for the same reasons as you (originally on a single core CPU) and I have found the best solution is to run a CPU with more than 6 cores @ at least 3ghz per core. No throttling solution I have ever experimented with comes close to the performance of that.

    I don't understand.. does throttling mean that you still get the same performance and just takes away all the rubbish overworking of the CPU or will it affect performance for the tradeoff of um not having your laptop heat up?

Join the discussion!