Knowledgebase: Audio Interfaces
Hyperthreading
Posted by Rick Shao on 16 November 2015 06:35 AM

Problem

We have found that many plug-ins and other applications do have severe problems when more than two CPUs (virtual or not) are used. Though Nuendo and Cubase are capable of dealing with more than two processors, the plug-ins and instruments loaded into the host may not.

Solution

If you are running a Xeon HT multi-CPU system or a Pentium Extreme Edition dual-core system including Hyper-Threading, you should disable HT in the BIOS. If you are running a single Pentium 4 CPU system, enabling Hyper-Threading results in an increase of processing power.

Background information

  • What is Hyper-Threading?

Extremely simplified, the CPU is devided into two main calculation areas instead of one. It appears to the OS and all applications to be a dual-CPU setup.

When the hardware manager is opened in Windows XP two independent CPUs are displayed. The Home Edition only supports the virtual CPU of a Pentium 4 Hyper-Threading system, but not more than one physical unit .

Amongs other tests, Intel have run this technology with Nuendo and experienced a 25% to 30% increase of available processing power compared to the same CPU with Hyper-Threading disabled.

So now, with all these terms like multithreading, multiprocessing, symmetrical multiprocessing, Hyper-Threading, OpenMP… We thought it would be a good idea to have a broad overview.

A few years ago, PC computing was simple: a desktop system had one processor that ran one program at a time. This simple model was the easy-to-understand world of MS-DOS* and Windows* 3.x. A user ran a program, which meant the operating system loaded into memory and the processor was entirely given over to its execution until the program completed. If the operating system needed the processor, it had to issue an interrupt. In response to the interrupt, the program would save its current state, suspend operations, and give control to the operating system.

Over time, other ways of handling interrupts were introduced, including the jury-rigging necessary to run two programs simultaneously. On MS-DOS, this required one program to run, finish executing, and then wait semi-dormant in memory while another program executed. It would wait for a specific interrupt to bring it to life and suspend the other program. Such software was called terminate-and-stay-resident (TSR). TSR was a nightmare to support because it was trying to get the operating system to do something it was not built to do: switch between two running programs.

  • Multithreading

When a program was waiting for a diskette drive to be ready or a user to type some information, programmers began to wonder if the processor could be doing other work. Under MS-DOS, the answer was unequivocally no.

Instructions were executed sequentially, and if there was a pause in the thread of instructions, all downstream instructions had to wait for the pause to terminate.

To come up with a solution, software architects began writing operating systems that supported running pieces of programs, called threads. These multithreading operating systems made it possible for one thread to run while another was waiting for something to happen. Today's operating systems, such as Windows 2000 and Windows XP support multithreading. In fact, the operating systems themselves are multithreaded. Portions of them can run while other portions are stalled.

To benefit from multithreading, programs also need to be multithreaded themselves. That is, rather than being developed as a single long sequence of instructions, they are broken up into logical units whose execution is controlled by the mainline of the program. This allows, for example, Microsoft Word* to repaginate a document while the user is typing. On single processor systems, these threads are executed sequentially, not concurrently. The processor switches back and forth between the threads quickly enough that both processes appear to occur simultaneously.

By switching between threads, operating systems that support multithreaded programs can improve performance, even if they are running on a uniprocessor system.

In the real world, large programs that use multithreading often run many more than two threads. Software like database engines create a new processing thread for every request for a record they receive. In this way, no single I/O operation blocks new requests from executing. On some servers, this approach can mean hundreds, if not thousands, of threads are running concurrently on the same machine.

  • Multiprocessing

Multiprocessing systems have multiple processors running at the same time. Traditional multiprocessing systems have anywhere from 2 to about 128 processors. Beyond that number (and this upper limit keeps rising) multiprocessing systems become parallel processors. Multiprocessing systems allow different threads to run on different processors. This capability considerably accelerates program performance. Now two threads can run more or less independently of each other without requiring thread switches to get at the resources of the processor. Multiprocessor operating systems are themselves multithreaded and they too generate threads that can run on the separate processors to best advantage.

  • Asymmetrical and symmetrical multiprocessing

On asymmetrical systems, one or more processors are exclusively dedicated to specific tasks, such as running the operating system. The remaining processors were available for all other tasks, generally the user applications. This configuration is not optimal. The operating system processors may be running at 100% capacity, while the user-assigned processors are doing nothing.

Symmetrical multiprocessing (SMP) is an architecture that balances the processing load better: The "symmetry" refers to the fact than any thread -be it from the operating system or the user application- can run on any processor. In this way, the total computing load is spread evenly

across all computing resources. Today, symmetrical multiprocessing systems are the norm, and asymmetrical designs have nearly completely disappeared.

Thread interaction has two components: how threads handle competition for the same resources, and how threads communicate among themselves.

When two threads both want access to the same resource, one of them has to wait. The resource can be a disk drive, a record in a database that another thread is writing to, or any of a myriad other features of the system. Minimising this delay is a central design issue for hardware installations and the software they run. It is generally the largest factor in providing perfect scalability of performance of multiprocessing systems, because running threads that never contend for the same resource is effectively impossible.

A second factor is thread synchronization. When a program is designed in threads, there are many occasions where the threads need to interact, and the interaction points require delicate handling. For example, if one thread is preparing data for another thread to process, delays can occur when the first thread does not have data ready when the processing thread needs it. More compelling examples occur when two threads need to share a common area of memory. If both threads can write to the same area in memory, then the thread that wrote first has to check that what it wrote has not been overwritten, or it must lock out other threads until it has finished with the data. This synchronization and inter-thread management is clearly an aspect that does not benefit from having more available processing resources.

System overhead is the thread management done by the operating system. The more processors are running, the more the operating system has to coordinate. As a result, each new processor adds incrementally to the system management work of the operating system. This means that each new processor will contribute less and less to the overall system performance.

  • Parallel and Massively Parallel Multiprocessing

Certain applications, generally in the scientific and military domains, require computation on massive quantities of data. For example, simulating weather patterns. Parallel Multiprocessing systems are very large multiprocessor platforms that have anywhere from a few hundred to several thousand processors. They are architected differently from the multiprocessing systems discussed earlier. They generally scale well across numerous processors and there is no diminishing return caused by adding more processors. This is because the nature of the computation is to divide the incoming data into discrete chunks that are assigned to individual processors. Eventually the calculated figures are all folded together again and the process repeats as needed. These systems generally have complex memory management systems.

On a budget, this is most commonly done by linking multiple computers via ethernet so each computer represents one CPU. These systems are then called Clusters, and a popular one currently is the Beowulf Cluster.

Programming parallel systems is a challenge because of the nature of the task partitioning and coordinating.

Multiprocessing, then, is the ability to use a machine with several processors to run multiple programs simultaneously or to run different threads from the same program.

  • Hyper-Threading Technology

Hyper-Threading Technology is a technology from Intel that enables a single processor to run two separate threads simultaneously. This in part stems from a design change Intel made in the release of the Pentium® Pro processor in 1995. The company added multiple execution units to the processor. Even though the chip could execute only one thread, the multiple execution units enabled some instructions to be executed out of order. As the processor handled the main instructions, a look-ahead capability recognized upcoming instructions that could be executed out of order on the other execution pipelines and their results folded back into the stream of executed instructions when their turn came up. This facility made for a more optimized flow of executed instructions. It also was used to speculatively execute instructions from a branch in an upcoming "if" test. When the mainline hit the test, results of pre-executed instructions from the correct branch would be used. If the speculation had pre-executed the wrong branch, those instructions were simply discarded. With each new generation of Pentium processors, the number of execution units on the chip grew. They mostly sat unused, springing to life only when out of order instructions could be shunted to them.

Using Hyper-Threading Technology, two separate threads can run simultaneously on one processor as long as they don't both require the same execution unit. The processor schedules the instructions of the two threads in interleaved fashion depending on which execution units are available. The two threads share the caches for data and instructions. In all ways, this arrangement looks like two processors. However, there are some key distinctions. The most important is that the threads rarely run at full speed. The interleaving almost certainly assures that there will be occasional collisions for resources. Hypothetical examples can be constructed where two threads do not ever interfere with each other, but they do not reflect a common scenario. In such cases, performance approaches that of two separate processors. In tested applications, Intel has attributed performance enhancements of around 30% to hyper-threading technology.

[Source: Intel corp.]

Intel's Hyperthreading technology has now been implemented not only into their range of Pentium 4 CPUs, but also into their mainly server-oriented Xeon models and the Pentium Extreme Edition dual-core solutions. This of course lets users have multiprocessor systems with two or more physical CPUs with additional Hyperthreading enabled, thus doubling the virtual number of CPUs. Many audio professionals (and semi-professionals or hobbyists with lots of money to spend) are purchasing and running these multi CPU/core systems.

Source: Steinberg © 2006 Steinberg Media Technologies GmbH

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
Help Desk by Phonic