• Please review our updated Terms and Rules here

How did early NT handle Multiprocessing?

NeXT

Veteran Member
Joined
Oct 22, 2008
Messages
8,123
Location
Kamloops, BC, Canada
I know that the first Microsoft OS to support multiple processors officially was NT but I've never figured out how that worked and how it was able to scale up when you had more physical processors. NT 4 for example supports multiple processors but at that time I don't believe any third party software was available yet to support it unless you wrote it yourself. Was NT able to load-distribute single-thread processes between cores as it detected them so no one core would remain idling?
Also when did Microsoft ship multiprocessing support for their commercial products like Microsoft Office and Visual Studio? Was it a later patch-in to enable multiprocessing/coding?
 
I know that the first Microsoft OS to support multiple processors officially was NT but I've never figured out how that worked and how it was able to scale up when you had more physical processors. NT 4 for example supports multiple processors but at that time I don't believe any third party software was available yet to support it unless you wrote it yourself. Was NT able to load-distribute single-thread processes between cores as it detected them so no one core would remain idling?
Also when did Microsoft ship multiprocessing support for their commercial products like Microsoft Office and Visual Studio? Was it a later patch-in to enable multiprocessing/coding?

I can't speak to specifics, but there's really not that much magic in supporting multi-processors. There's lot of room for improvement, to be sure, especially with code specifically designed to work on mulitple cores. But running multiple processes on multiple processors is not a great leap, even within the kernel.

The secret is locking. Early OSes on multi-processor systems just locked everything that may touch shared state, via a single, shared Giant Lock, and then let it run. This Giant Lock restricted access to shared state across all of the CPUs.

Applications like Office or Visual Studio at the time probably weren't overly affected. The only space for real concern is the shared memory model and how that's manifest for things like threads (which are shared sub processes within an overarching process) vs the high level processes, which share "nothing". Threads on MP systems can get in to trouble with shared state being accessed across CPUs. If there was a lot of threading on those early systems, they could have certainly run in to trouble on an MP system. However, the NT kernel may well have simply scheduled the threads on to the same processor as the primary process -- which eliminates most of those problems.

Once those things are done, then the system isn't that much different. You have an MP system, it's just less efficient than it could be. MP systems were certainly not new when NT came around, but the ramifications of running on such systems for application programmers weren't as widespread.

But, consider, Linux got rid of its Giant Lock in 2011, FreeBSD in 2019, OpenBSD and NetBSD still have the Giant Lock.

So, its important, but not necessarily that important.
 
Microsoft's first product to support multiple processors was SQL Server, asymmetrical before symmetrical. It will run loads on all the processors though not necessarily getting the optimum balance between processors. In many cases, the asymmetrical loading with OS on one core and applications on the others worked out well enough.

Office does not do much with SMP. Excel 2007 was the first with an option for multi-threaded calculations which can be spread among multiple cores. I don't remember when Word split spellchecking to its own thread which could work on a different processor though I think it was much earlier than Excel. Visual Studio documentation suggests that parallel builds were introduced in 2008 defaulting to one build per core.
 
I know that the first Microsoft OS to support multiple processors officially was NT but I've never figured out how that worked and how it was able to scale up when you had more physical processors. NT 4 for example supports multiple processors but at that time I don't believe any third party software was available yet to support it unless you wrote it yourself. Was NT able to load-distribute single-thread processes between cores as it detected them so no one core would remain idling?
Also when did Microsoft ship multiprocessing support for their commercial products like Microsoft Office and Visual Studio? Was it a later patch-in to enable multiprocessing/coding?

I don't believe that the Multi Processor support in the OS has changed much from NT through to current versions of desktop and server. One difference is that modern systems can cope with "None Uniform Memory Access" or NUMA where CPUs have faster access to some parts of memory.

The first version of Microsoft Exchange released in 1995 would exploit multiple CPUs but from what I remember it did this by having multiple services. We ran this on a dual pentium pro box. A single thread can only be scheduled on a single CPU (or core for multiple cores) and that is the same today as it was in NT4. Even today I don't think that Office really exploits multiple CPUs for single applications. Perhaps when you are re-paginating, or allowing you to read mail while mailboxes are synchronizing. There were never patches for these, changes to products only came at release boundary's. Making something multithreaded is not the sort of thing a patch can enable.

I don't believe that much software exploits multiple threads, writing multiple threaded software is challenging. Some heavy CPU packages can do so for example LTspice a circuit modelling package can exploit multiple CPUs and use the GPU because it is solving matrixes and so can do multiple calculations in parallel. One common question on the LTspice list is "why is only one core being used" and the answer is that your problem isn't complex enough.....
 
All one need to do is to look at the kernel API for the NT DDK. Lots of semaphore, mutex and spinlock stuff there.

One can get writer's cramp from the long function names.
 
I know that the first Microsoft OS to support multiple processors officially was NT but I've never figured out how that worked and how it was able to scale up when you had more physical processors. NT 4 for example supports multiple processors but at that time I don't believe any third party software was available yet to support it unless you wrote it yourself. Was NT able to load-distribute single-thread processes between cores as it detected them so no one core would remain idling?
Also when did Microsoft ship multiprocessing support for their commercial products like Microsoft Office and Visual Studio? Was it a later patch-in to enable multiprocessing/coding?

This sort of question is one that should be discussed in one of the brewpubs with unfiltered beer. Are there still some in downtown Kamloops?
 
Microsoft's first product to support multiple processors was SQL Server, asymmetrical before symmetrical. It will run loads on all the processors though not necessarily getting the optimum balance between processors. In many cases, the asymmetrical loading with OS on one core and applications on the others worked out well enough.

Office does not do much with SMP. Excel 2007 was the first with an option for multi-threaded calculations which can be spread among multiple cores. I don't remember when Word split spellchecking to its own thread which could work on a different processor though I think it was much earlier than Excel. Visual Studio documentation suggests that parallel builds were introduced in 2008 defaulting to one build per core.

Microsoft LanMan had some rudimentary support for the Compaq SystemPro's asymmetric multi-processors under OS/2, IIRC.
 
You might want to check out Dave Plummer's YouTube channel. He was on the NT team, wrote task manager among other things, and is doing live streams where you can ask just this sort of question and get an answer from source.
 
For the Intel x86 architecture, it relied upon the Intel MultiProcessor Specification:
https://en.wikipedia.org/wiki/MultiProcessor_Specification
their APICs,
https://en.wikipedia.org/wiki/Advanced_Programmable_Interrupt_Controller
or similar features of the other CPU architectures.
http://datasheets.chipdb.org/Intel/x86/Pentium/Embedded%20Pentium%AE%20Processor/OPERATN.PDF

These require specific motherboard design features and BIOS/POST initialisation, as well as OS support for multi-tasking and/or multi-threaded tasks, the SMP or ASMP configuration depending upon whether or not one "Primary" CPU predominantly handled more of the functions, e.g. all external Interrupt Processing.
 
Last edited:
Back
Top