This is a research paper I wrote for my Operating systems class.

Multi-core processors
Scott Mink - April 2, 2005

Over the last fifteen years the need for more powerful computers has been driven by the rapid adoption of computer technology. Ten to fifteen years ago most home and business desktop computers were used for word processing and internet access, web servers provided mostly static content, and large business databases were normally on mainframes. Today even home users are editing photos and video on their PCs, web sites are dynamically generated and personalized for each visitor, and businesses are storing huge amounts of data on midrange servers. Within the next few years the need for computing power will continue to grow rapidly as home computers become an integral part of entertainment systems, video games become evolve into simulations of real life, and business needs continue to grow (AMD). Currently a common solution used in business servers and high end workstations for increasing computing power beyond the abilities of currently available processors is to use multiple processors in a single computer with operating systems that support symmetrical multiprocessing, or SMP.

By the end of 2005 both Advanced Micro Devices and Intel are expected to be shipping multi-core versions of their x86 processors for desktops and servers. These new chips contain multiple microprocessor cores on a single chip. Each core can execute instructions independently from each other, so multiple instructions can execute simultaneously. This new breed of chips is expected to greatly increase the performance of desktop and server systems over the next few years. The idea of multi-core processors isn't new; it was predicted in an article titled "Microprocessors Circa 2000" in the October 1989 issue if IEEE Spectrum. The article envisioned these new processors would be released soon after the turn of the century (Intel a). Functionally these chips are very similar to the way SMP has worked for several years. There are several advantages to using multiple processing cores on a single processor chip instead of having separate chips for each processor.

One major advantage multi-core processors have over SMP is that they generate much less heat. The heat generated by processors has increased with the increases of clock speed, and is one of the major obstacles to continuing to increase the speed further. The prototype multi-core processors that have been demonstrated by Intel and AMD contain two x86 processors on a single chip and generate only slightly more heat than a regular single core processor. This, along with similarly low power consumption, makes multi-core processors an especially attractive option for small form factor devices such as blade servers and laptops where multiple processors would be difficult to implement.

A related technology is Intel's Hyper-threading, which simulates multiple processors to the operating system while executing all of the instructions on a single processor core. The Hyper-threaded processor contains two architecture states, each containing a complete set of registers and an interrupt controller, and appears to the operating system as two separate processors. The architecture states share almost all of the other processor components, such as the cache, busses, and other resources, and since they share these other resources there is a high level of data locality compared to separate processors or even multi-core ones. According to Intel, this duplication of architecture state hardware adds little to the number of transistors required on a processor, but noticeable increases performance by allowing for more efficient use of the common resources. (Intel b) Additionally, having multiple streams of instructions to choose from increases the options for pipelining and allows for more efficient utilization of the Arithmetic Logic Unit, or ALU. Pipelining is the process of arranging order of the instructions to be executed so that unused parts of the processor can start working on the next instruction before the current one is completed. Still, all instructions are executed by the same core, so it is impossible to be as fast as a dual core processor.

In order to take advantage of the power of either multi-core processors or SMP the operating system needs to have been designed with the ability to schedule tasks for multiple processors. Most of the operating systems currently on the market, including the current versions of Windows, Linux, and Unix support multiple processors, but many of the Microsoft's previous operating systems, such as Windows 95 and 98, do not. When we think of a typical single processor computer running a modern operating system we think of multitasking as the ability to run multiple programs at the same time, but in reality only a single process can run on a CPU at any time. The heart of any operating system is its CPU scheduler, which keeps track of all of the processes that are running and switches between them, assigning each to the CPU for a few milliseconds at a time. To the user it appears that all of the applications are running simultaneously, when in reality only one is executing at any given moment. Each time the operating system switches the running process is called a context switch, and involves a process of backing up all of the data stored in the registers that relate to the old process, loading the registers that will allow the operating system's CPU scheduler to run, the scheduler running to decide which process to run next, and the registers for the next process to be loaded. This becomes much more difficult with multiple processors or multi-core processors since the CPU scheduler has to keep track of multiple processors and what code is running on each.

For the application developer, the techniques for writing applications to take advantage of multi-core processors are the same as they are for current multiprocessor systems. Applications need to be heavily threaded, and need to take advantage of OS threads instead of library threads. OS threads is seen by the operating system as separate processes that need to be scheduled independently and can be executed simultaneously with other threads that are a part of the same program, while library threads are seen as a single process to the operating system and are scheduled within the execution time of that single process. Since the operating system cannot run more than one copy of a process, or at least has no reason to, the library threads are limited to running on a single processor at any given time.

An issue related to the adoption of these new processors is software licensing. Currently some operating systems and enterprise level applications, such as database servers, are licensed on a per processor basis with the assumption that each chip is a processor. With the addition of additional processor cores on a single chip each software vendor must reevaluate and clarify what it considers to be a processor. Should the licensing be per chip or per core? So far Microsoft, which licenses its SQL server on a per processor basis, has announced that they will consider a multi-core processor as a single processor for licensing purposes (Microsoft), while IBM and Oracle have both announced that for their database products they consider each core to be a processor, so a multi-core processor would need a separate license for each core (Oracle). The decision on the Windows operating system might be a little more complex, as the processor limit is actually hard coded into each version. For example, Windows XP will only use two processors and will see a single dual-core chip as two separate processors. As such, no matter what Microsoft decides about licensing, the operating system will not use all of the available CPU cores if it is installed on an AMD system with two dual-core processors or on an Intel system with dual cores that support Hyper-threading.

The move to multi-core processors should be fairly easy, especially since a great deal of the software we use will not need to be modified to support the new hardware platforms. Current operating systems, already designed to take advantage of multiple processors, will work unmodified. Application developers will have to put more thought into the design of their programs, but the process for them will be the same as it currently is for designing software for SMP systems, and existing single threaded applications will continue to work as they always have; limited to running on a single core at a time.

References

AMD (n.d.). AMD Multi-core white paper. Retrieved March 19, 2005, from http://www.amd.com/multicore_technology_whitepaper2/.

Intel a (n.d.). Intel multi-core processor architecture development backgrounder. Retrieved March 19, 2005, from http://www.intel.com/cd/ids/developer/asmo-na/eng/201969.htm?prn=Y.

Intel b (n.d.). Hyper-Threading Technology. Retrieved March 19, 2005, from http://www.intel.com/technology/hyperthread/.

Microsoft (2004) Multicore Processor Licensing. Retrieved March 19, 2005, from http://www.microsoft.com/licensing/highlights/multicore.mspx.

Oracle (n.d.) Interview with Jacqueline Woods, Vice President of Global Pricing and Licensing Strategy, Oracle Corporation: Multi-core Processors - Impact on Oracle Processor Licensing. Retrieved March 19, 2005, from http://www.oracle.com/corporate/pressroom/jwoods_multicore.html.