Multi-core or multiprocessor?

01 April 2007

Multi-core processing has been touted as the next generation of improvements in processing power. Performance looks set to improve once more having been plagued by problems of heat and power consumption resulting from increased processor clock speed

Automatically implemented multi-threading

How easy it is to use these parallel processing architectures, both in terms of multi-tasking between several applications at the OS level and creating an application that is multi-threaded itself.

The main difference between multi-core systems and the multiprocessor systems that have been available for many years is that the former use a single physical device containing two or more processing cores while the latter include two or more physical devices. Multi-core systems also share computing resources that are often duplicated in multiprocessor systems, such as the Layer 2 cache and front-side bus. They provide similar performance but a multi-core processor costs less than the equivalent multiple processors that require a motherboard with support devices.

Multi-tasking
Multi-tasking refers to the ability of the OS to switch between tasks quickly, giving the appearance of simultaneous execution. Present-day user interaction enables a user to work on concurrent applications. However, as soon as a computationally intense task is started, like rendering a complex CAD image or running a complete virus scan, the multi-tasking capability of the OS reduces dramatically.

When running on a multicore system, a multi-tasking OS can execute multiple tasks simultaneously, as opposed to only appearing to do so. On a dual-core system, two applications can each access a separate processor core at the same time, thus improving the performance of the individual applications, especially when handling high data throughput.

Multi-threading
Multi-threading is similar in principle to multitasking, except that the advantages are present within a single application. The OS can divide processing time not just across different applications but also across each thread within an application. It is possible to break an application down into different tasks or threads of execution, which can take place independently of each other with minimal passing of data between them. Applications using multi-threading provide numerous benefits, including more efficient CPU use, better system reliability and improved performance.

Looking at a more specific example where synchronous calls are being made to external resources, such calls often take a long time to complete. In a single-threaded application, a synchronous call effectively blocks any other task within the application from taking place until the operation is completed. Multi-threading prevents this blocking. While the synchronous call runs on one thread, other parts of the program that do not depend on this call run on different threads, thus maximising the efficiency of the CPU.

An application with an architecture containing multiple execution threads can prevent low-priority operations from adversely affecting those that are timecritical. The most common example is the effect that the user interface can have on more time-critical operations. It is often the case with single-threaded applications that screen updates or responses to user events can decrease the execution speed of an application. By using multiple threads and giving the user interface thread a low priority, the user interface operations do not prevent the CPU from executing more important operations, such as real-time data analysis. Improved performance

When a multi-threaded application is run on a multi-core processor, there are some high performance improvements. Intel uses an approximate 70 per cent performance increase as a benchmark and achieves this by adding an additional core while maintaining the same power consumption as a single core(achieved by reducing the clock frequency by 20 per cent).

In a multi-threaded application with several threads capable of running simultaneously, each core can run a different thread and the application runs in parallel. This not only enhances the previously discussed benefits of more efficient CPU use and better system reliability, but also increases performance. With access to higher performance, it should be easy to create a multi-threaded application.

Parallel over sequential
From bio-medical devices to cutting-edge consumer electronics prototypes, graphical system design enables the rapid design, prototyping and deployment of embedded systems using graphical programming combined with programmable hardware. Graphical system design takes advantage of each innovation in the PC industry.

Multi-core processing is no different. When developing software that uses the computing power of multi-core processors to the full, a development tool that provides parallelism is needed. Because of their sequential nature, text-based programming languages, such as C and C++, require functions to spawn and manage threads, which is one of the fundamental limitations of this technology.

In contrast, in graphical programming environments, such as LabVIEW, the data flow paradigm is inherently parallel, with the execution paths of graphical code residing side by side. LabVIEW code is also multithreaded. LabVIEW recognises opportunities for multi-threading in programs and the execution system handles multi-threading implementation and communications. For example, two independent loops running without any dependencies automatically run in separate threads. When LabVIEW code is executed on a multi-core system, the multiple threads run on the multiple processor cores without requirement for additional programming.

Multi-core systems of the future
The dual-core processors on the consumer market have seen quick adoption and the performance benefits have been plain to see. The alliance between Sony, Toshiba and IBM, known as STI, developed a microprocessor architecture called the Cell Broadband Engine Architecture. The first major commercial application of the chip was in the Sony PlayStation 3 games console, which contains one main processing core along with eight lower-performance processing units. It has become apparent that developers are struggling to design applications for such processors.

Programmers wish to continue reaping the benefits as the world moves towards processors with dozens or hundreds of cores. Intel laid this out in its vision of Tera- Scale computing, where people will need teraflops (a trillion floating point operations per second) of computing power. In order to achieve this, powerful graphical system design tools like LabVIEW will be key.

TRISTAN JONES is technical marketing engineer, National Instruments UK & Ireland


Contact Details and Archive...

Related Articles...

Most Viewed Articles...

Print this page | E-mail this page