This article is more than 1 year old

Top tip from the original Task Manager taskmaster: Don't put your phone number on that debug message box

The Reg takes sneak peek at source tour, hosted by engineer who wrote it

Retired Microsoft engineer Dave Plummer has continued his series of Windows insights with a rummage around historical Task Manager source code.

Plummer talked about his role in the creation of Task Manager earlier this year and has posted a series of videos on the subject on his YouTube channel over recent days, culminating in today's probing of the source code (via Visual Studio Code on Mac).

Famously a hobby project that caught the eye of Windows NT supremo Dave Cutler and added to the source tree, Task Manager was, according to Plummer, "the only time in my entire Windows career that I had the opportunity to create a new main() for an application in the product."

Plummer recalled a desperate attempt to track down a near-impossible-to-recreate CPU totalling bug that led him to add, and then forget about, an assertion that popped up his home telephone number whenever usage came to more than 100 per cent. The assertion was removed when the bug was fixed, but not before it found its way into the beta.

And the bug? It wasn't the kernel. It couldn't be the kernel.

It was the kernel.

Plummer revealed that at first Cutler had him put the "technical and nerdy" Task Manager at the very top of the Start Menu, "which was basically received as a big middle finger by the Windows 95 shell designers" who had the mission of simplifying the PC experience. It was later shifted to the more reasonable System Tools.

Plummer also took viewers on a tour of the C++ source code behind the scenes (or at least as it was around the time of his retirement, in the era of Windows XP and Server 2003).

Sadly, while Microsoft gave permission for Plummer to show portions of the source on YouTube, the 22,000 or so lines of code have yet to trouble a public GitHub repo à la DOS or File Manager. There is, after all, every chance that large chunks of it may still be lurking within the live product (although the Windows 10 Task Manager is a very different beast visually to that of Plummer's era).

Microsoft might also need to clean up the comments a bit; Plummer highlighted one section where his 20-plus-years-ago self had annotated the code with:

// Yes, I could use virtual destructors, but I could also poke
// myself in the eye with a sharp stick. Either way, you wouldn't
// be able to see what's going on

The Register asked Plummer if there was anything else he came across that made him wince. "My original code assumed you would never have more than 32 CPUs," he replied. "In a world where simply having two CPUs was exotic and super expensive, I guess 32 seemed beyond reality to me in 1995. My own desktop 3970X would break it today!"

As for tips for his younger self – because let's face it; looking at one's own code from decades past can be traumatic in the extreme – Plummer told us: "Using the name Dave in so many of the function names seems a little odd now. It's not something I do now!"

Plummer directed kudos towards the current incarnation, telling us he was impressed with how it has "maintained that original vision of being compact, fast, and reliable," but remained proud of the resilience of his early code: "If you corrupt its registry data, it can effectively uninstall and reinstall itself silently behind the scenes to repair itself. If system resources aren't available, it does without. Most applications are content to, at most, validate that their assumptions are true. Task Manager adjusts and adapts to the reality of the situation, which is a step beyond."

His tour of the Task Manager source can be found here, and the previous parts (along with time-absorbing gems such as poking around in the innards of Atari's Tempest) are on the engineer's Dave's Garage channel. ®

More about

More about

More about

TIP US OFF

Send us news


Other stories you might like