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]


The Cheapest NBN 50 Plans

Here are the cheapest plans available for Australia’s most popular NBN speed tier.

At Lifehacker, we independently select and write about stuff we love and think you'll like too. We have affiliate and advertising partnerships, which means we may collect a share of sales or other compensation from the links on this page. BTW – prices are accurate and items in stock at the time of posting.

Comments


5 responses to “Limit The CPU Usage Of Misbehaving Programs With ThreadMaster”

Leave a Reply