Skip to main content
gamedev.net
🔒 Locked

HyperThreading and MMX?

Started by DvDmanDT Sep 25, 2005 at 5:41 AM 1 replies 1.3k views
Original Post
DvDmanDT
DvDmanDT
Hello everyone.. What happends if I have a multithreaded application, running on an hyperthreaded cpu, where one tries to use MMX and one tries to do some regular fp math? Would it work fine, or would I get some extremely wierd crash? Can someone please explain hyperthreading? Does both processing threads share the same registers? Why does everyone want multicore CPUs when you can have Hyperthreaded? Thanks!
c2_0
c2_0
In a hyperthreaded core, each logical core has its own set of registers, but shares much of the logic units.

As compared to a normal, single threaded CPU, in a hyperthreaded configuration the processor can more effeciently make use of its logic units, since they wouldn't be sitting idle as much as if just one thread was executing on them.


In a multi-core CPU, each core contains its own set of registers and logic units.

With completely separated cores, concurrent threads don't share any internal CPU resources (although, they might share the memory bus, or even caches in some configurations).



As for crashes, no, you shouldn't see any...
In cases where the architecture of the CPU demands that certain parts cannot be shared between threads, it would be the job the operating system to protect user applications from this.
Raghar
Raghar
Quote:
Original post by DvDmanDT
Hello everyone.. What happends if I have a multithreaded application, running on an hyperthreaded cpu, where one tries to use MMX and one tries to do some regular fp math? Would it work fine, or would I get some extremely wierd crash?


You would get 50 cycles worth of latency, because of MMX state handling, floating points should be done with SSE/SSE2 instructions. Real assembly programmers are using MMX register as a temporally register to increase amount of general purpose registers on a registry starved computer. Of course this would happen only when they would like to use the same part of a CPU.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.