seismologist said:
Maybe you guys can answer this. My (limited) understanding is that we've reached a threshold in single core performance. So to reach the next level of performance we need to move to multi-core designs.
But now it seems that the CPU on the latest consoles may actually be less powerful than a single core high end CPU. Wouldn't this totally defeat the purpose?
So I'm confused, what exactly is the reason for going multi?
I found this to be an extremely enlightening read:
http://www.gotw.ca/publications/concurrency-ddj.htm
It basically says that we've reached a speed limit (4 Ghz). To get more computing done in the same amount of time, instead of making our processors faster, we're switching to having more processors. The reason a performance improvement is possible with more processors is because a lot of code is parallelizable (meaning the code can be processed at the same time.)
Example of Parallelizable code:
1) R1*R2 -> R7
2) R3*R4 -> R8
3) R5*R6 -> R9
Because R1 through R6 have no dependencies between each other, we can execute lines 1,2,3 all at the same time. If we zoom out and look at longer orchastrations, sections of code which are not dependent on eachother can be put in separate threads and executed at the same time.
Example of non-parallelizable code:
1) R1*R2 -> R3
2) R3*R4 -> R5
3) R5*R6 -> R7
Here we see that every computed result gets used in the next line of computation. This prevents parallel execution of the lines because line i+1 is waiting on line i to finish executing. This code sequence MUST be executed sequentially and in order. This code is essentially not parallizable.
I don't know too much of the theory of concurrent programming and optimal threading. But it is what I'm going to dive into here pretty quick. I'm of the mind that if it can be done in a separate thread, it should be done in a separate thread. (Minus the cost of spawning and synching parallel threads).
Most programs are single threaded when they could be implemented in a multithreaded way. The reason we haven't implemented in a multithreaded way is because we've only had 1 processor which could only process 1 thread at a time.
To continue getting performance increases, we have to start writing multithreaded code. "What can be parallelized, should be parallelized." This is how a single app can take advantage of a multiple processor machine. If we don't switch to multithreaded applications, the app will be single threaded and only work on 1 processor at a time.
To sum up: The reason we are switching to multicore is because we are hitting a speed ceiling on processors. To take advantage of multicore, however, we must exploit parallelisms in execution of code wherever possible and efficient. The reason we can gain an advantage in a multicore environment is because most code contains parallelism which are not currently being exploited and cannot be exploited on single processor architectures.