Quote:
Originally Posted by mazex
OK - I understand. If you now get the concept I described that the programmer has to create threads himself or everything runs in one thread etc, then read the wikipedia article about Hyper-threading which I think is what confused you (and many else!):
http://en.wikipedia.org/wiki/Hyper-threading
So in a hyperthreaded CPU the OS thinks it has two CPU:s (or cores - whatever). It can then run the main game loop thread on the first one and the AI thread on the other (from the previous example). The problem (or finesse) is then that the CPU uses it's registers and fat cache to internally switch between the threads without the OS having to care or do that as the CPU has better and faster knowledge about when there is a "slot" of idle time in the game loop so the AI thread can get access to the actual CPU (which is only one). This does not fix the problem of knowing if that 109 is dead or alive though as the two threads running on what both the OS and your code thinks is two really CPU:s don't get any help from this - and they have to be written just like a normal multithreaded application... And if one of the threads constantly uses the single CPU that other thread will not get any cycles to the CPU has to force it into wait and give some CPU time to the AI thread... Therefore HT can be good in some cases but as it's really a smart way to fill available slots of excecution time - but there is really only one "brain"... 
|
I know about hyperthreading (cores vs threads etc).
I wonder how different bulldozer will be interms of programming for it. Havent heard a huge amount on it tbh.