Any server can benefit from multiple-core processors. But what's the practical benefit of multiple-core processing
on desktop PCs?
PCs today -- regular garden-variety desktop PCs -- are shipping with processors that sport multiple cores -- sometimes two or sometimes even four. The net effect is like having two or four processors in one in a smaller package and with far less power consumption than an actual two- or four-processor machine. With CPU speeds topping out, adding multiple cores to CPUs has shaped up to be the next big way to increase performance.
Do users running nothing more exotic than Microsoft Office or Web browsers get anything out of a multi-core architecture? The short answer is yes, but precisely how they benefit from a multi-core processor requires some explanation.
First, you have to understand how the operating system uses multi-core processors. In order to use them, an OS has to be "aware" of multiple cores, which appear to the user and the programs running on the system as separate processors. If the OS isn't aware of multiple cores, it will only "see" a single processor, and the other cores will go unused -- and wasted -- by both the OS and its applications.
Windows Vista recognizes multiple cores instantly
However, just about every current operating system -- Windows XP, Windows Vista, all breeds of Windows Server and Linux -- recognizes multiple cores and can work with them. You must patch Windows XP with Service Pack 2 or better to recognize multiple cores, but even Windows XP Home Edition can make use of multiple cores once you satisfy that condition. Windows Vista recognizes multiple cores out of the box immediately, and any Linux based on the 2.6 kernel or better should behave the same way.
Another key distinction is how a system handles multi-core processors compared to multiple physical processors, or sockets. A multi-socket system contains more than one physical processor, each of which is plugged into a separate socket. Microsoft has a licensing restriction about the use of multiple sockets. Lower-end versions of Windows will recognize multiple cores, but they won't recognize more than one physical socket.
If your PC has two Intel Core 2 processors -- four cores -- Windows XP Professional will see both physical processors and all four cores. However, Windows XP Home will see only the first processor and only two cores. Windows Vista Home, in all its incarnations, supports only a single socket although it will support multiple cores. Vista Business and Ultimate will support up to two sockets.
As a side note, Microsoft's general policy about licensing software on systems with multiple cores or sockets is that each Microsoft product is licensed on a per-socket basis, not per core. So if at some point you ran Windows XP Home on a single-processor machine that had eight cores, all eight cores would be available to XP Home to use. Microsoft correctly guessed that multi-core processing would become a standard-issue, desktop-level technology and to that end changed its licensing to reflect this. The company is licensing its other software products -- not just their operating system -- in the same way. SQL Server is licensed on a per-socket basis, not on a per-core basis.
Better apps performance and multi-threads yield instant benefit
Assuming you have the OS to handle multiple cores, and it's almost a given that you will, the next key element is the applications. This is where people will see an immediate benefit from multiple cores -- better performance for multiple applications running side by side.
The other benefit is for programs that can run in multiple threads, with each thread handled by a separate core. Your average music player program, for instance, might be ripping music (one thread), playing music (another thread), periodically monitoring its library folder for changes (another) and so on. Some of these threads, like the library-monitoring thread, may run in a passive fashion -- they only run intermittently or use very little CPU when they do run.
Most existing Windows applications have at least some degree of "multi-threadedness." Even some applications that don't look like they're multi-threaded do, in fact, run in multiple threads. Microsoft Word, for instance, uses multiple threads to do things like spell check or paginate documents in the background as you type. The more that a series of given operations in the program can be parallelized, or run side by side without stomping on each other's toes, the better they'll run in a multi-core system.
The problem with multithreading is that some types of work don't lend themselves easily to being done in multiple threads. One example of this is compressing video or audio. The term used for this kind of work is temporally dependent, meaning that the encoding of any one part of the data depends on data from a previous part, so the encoding has to be done front-to-back in a single thread. It's still better to have multiple cores in such a situation because one core can take the brunt of the encoding work and leave the others unburdened for other work.
In theory, it is possible to optimize some kinds of temporally dependent operations for multiple cores or processors. For instance, if you're compressing something for DVD, the video and audio could be compressed separately -- although they would still have to be re-synched later, and that might undo any of the performance gains from compressing audio and video in parallel. Few desktop applications suffer from these kinds of restrictions -- but the few that do will only run as quickly as any one core in the system.
More efficient application and desktop responsiveness
The average user will indeed notice a major performance boost by running a multiple-core machine, especially when using today's operating systems and applications. Things like application and desktop responsiveness will run all the more efficiently. So will running multiple programs side by side.
However, not everything will benefit equally. Making video compression or other temporally dependent operations run better in a multi-core environment is a problem that's faced by programmers who now have to adapt to a world where multiple cores and processors are the norm.
But there's work going on in this area. Intel Corp. has a white paper on a programming technique designed to optimize video encoding on a multi-core system. It has also released Threading Building Blocks 2.0 — a multi-core-optimized programming library in C++ — under the terms of the GPLv2 for all to use. In the meantime, though, there are enough immediate real-world benefits for casual users that dual- or multi-core processing is scarcely a waste.
About the author: Serdar Yegulalp is editor of Windows Insight (formerly the Windows Power Users Newsletter), a blog site devoted to hints, tips, tricks and news for users and administrators of Windows NT, Windows 2000, Windows XP, Windows Server 2003 and Vista. He has more than 12 years of experience working with Windows, and contributes regularly to SearchWinComputing.com and other TechTarget sites.