質問

Not sure if that is even possible in a managed language, but is it possible to actually make an application perform better in the presence of hyper threading ?

Is there something specific that can be done in the code ? , maybe some functions run better than other in HT environments ?

I know that to benefit from multi-threading, all that is needed is to spawn new threads to perform heavy cpu tasks, but I am not sure what is required for HT ?

役に立ちましたか?

解決

Depends a lot on the actual hardware you have. Read Be aware: To Hyper or not to Hyper for a more in dept analysis. Slava's point in the link is that in HT the virtual cores share the cache and a the virtual core workload can trash the cache of the 'main' core and, even though it can do at best some 20% of workload compared with the main core, becuase it evicts the hot cache of the main core, it cause the main core to stall and overall results in worse performance than w/o HT.

But a lot of things have changed since the article was posted, HT post Nehalemis significantly better.

I know that to benefit from multi-threading, all that is needed is to spawn new threads to perform heavy cpu tasks

That is quite a naive view. You must read Rick Vicik articles on high performance windows programs (they apply to managed apps too) and you must absolutely understand CPU Caches and Why You Care.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top