Thursday, September 4, 2008

The Basics of Hyper-Threading: What is it?

The Basics of Hyper-Threading: What is it?


Modern processors can only handle one instruction from one program at any given point in time. Each instruction that is sent to the processor is called a thread. What I mean is that even though it looks like you're multitasking with your computer (running more then one program at a time) you're really not.


The CPU will divide it's time and power evenly between all the programs by switching back and forth. This little charade of switching back and forth tricks the end user (you and me) and gives us the sense of multitasking.


Dual CPU based systems can work on two independent threads of information from the software but each processor is still limited at working on one thread at any given moment though. The software must be able to dish out two separate pieces of information like Win2000 or Adobe Photoshop for a dual processor system to be really used, by the way.


So what's new with the Pentium4 3.06GHz processor?


The Pentium 4 3.06 GHz processor is the first Intel desktop processor in history that can process two independent threads at the same time. With a SMT (Simultaneous Multi-Thread) enabled OS like Win2000/XP, Linux, etc. the operation system will identify the P4 3.06 GHz CPU as two logical processors that share the single physical CPU's resources. A physical processor can be thought of as the chip itself, whereas a logical processor is what the computer sees - with Hyper-Threading enabled the computer can have one physical processor installed in the motherboard, but the computer will see two logical processors, and treat the system as if there were actually two processors.


Even when we put a regular processor under 100% load, we're never fully utilizing 100% of the execution units. With a HyperThreading enabled processor those spare execution units can used towards computing other things now.


In the last HyperThreading enabled processor, both threads are simultaneously being computed, and the CPU's efficiency has increased from around 50% to over 90%!


The last example is of dual HyperThreading enabled processors which can work on four independent threads at the same time. Again CPU efficiency is around 90% (and in this case there would be four logical processors, and two physical processors).


While this all sounds very good in the above example, it's also about the most ideal situation ever - so let's get back to the real world.


If you were to run two pieces of software that are completely different, and use different execution units, your system performance should get a noticeable boost however!


The operating system will also play a key role in how well HyperThreading works. The OS assigns operations to the independent logical processors, and so if it's determined that one of the logical CPU's is to remain idle, the OS will issue a HALT command to the free logical processor thus devoting all of the other system resources to the working logical processor.


As you can see, HyperThreading has the potential to significantly boost system performance under certain circumstances. From Xeon/HyperThreading test results over at Anandtech you get a feel that HyperThreading Technology is still in it's infancy in terms of real added value across the board. As it stands now, the performance that HT brings to the table is still very application specific. Some programs will notice a performance boost, and in some cases, other programs will see a performance hit with HT enabled.


As more and more software is written specifically for HyperThreading, the performance differences will grow larger. It didn't take long for software developers to adopt SSE2, hopefully they'll jump on the HyperThreading bandwagon quickly and the consumer will see the benefit of this this ingenuous technology quickly


3 comments:

  1. Hi!

    I would like improve my SQL experience.
    I red really many SQL books and still feel, that I am not a whise man
    in SQL. What would you recommend?

    Thanks,
    Werutz

    ReplyDelete
  2. Hi!

    I would like improve my SQL experience.
    I red really many SQL resources and still feel, that I am not a whise man
    in SQL. What can you recommend?

    Thanks,
    Werutz

    ReplyDelete
  3. If you are talking about T-SQL/PL/SQL you need to write the number of scripts, read as tutorial for the database as possible.

    ReplyDelete