Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

Q&A: Hyper-Threading and Assembler

Intel_Software_Netw1
616 Views
Here is a question received by Intel Developer Services Support, followed by the response provided by our Application Engineers:
Q. I wonder if there are any adaptations of Hyper-Threading technology in assembler? Can I write any programmes (including the simplest ones) which use this technology? Howdo Ido this? Could you give me some examples of source code which I can use in assembler with explanation and comments?
A. The first thing to understand about Hyper-Threading Technology is how it's implemented. Here is a link to a tutorial that explains how Hyper-Threading works: http://or1cedar.intel.com/media/training/hyper_threading_intro/tutorial/index.htm.
In a nutshell, Hyper-Threading Technology allows a single processor to appear as 2 processors to the OS. This is done by duplicating a few resources on the actual CPU so that there can be 2 architectural states. Since there are not 2 actual physical processors available to the OS as there would be in a dual-processor system, we say there are 2 logical processors.

In order to take advantage of this technology, an application would need to be threaded. Existing applications that are threaded for multi-processor systems should automatically take advantage of Hyper-Threading technology. This paper,
http://www.intel.com/cd/ids/developer/asmo-na/eng/downloads/code/languages/cpp/20491.htm?page=1, includes a link to download sample code that has some assembly instructions and some threading.
Now, once you've written your code, you may want to look at optimizing it for maximum performance. This tutorial, http://or1cedar.intel.com/media/training/spinloop/tutorial/index.htm, shows a few threading techniques (along with small code samples) to use on IA-32 processors to achieve maximum performance.
==
Lexi S.

IntelSoftware NetworkSupport

http://www.intel.com/software

Contact us

Message Edited by intel.software.network.support on 12-07-2005 04:45 PM

0 Kudos
0 Replies
Reply