2 ms·
The hardware itself automatically parallelizes execution of your program to some degree. When you say something like: int i = 0, j = 1, k = 2; The processor i
by grogers 17y ago
The hardware itself automatically parallelizes execution of your program to some degree. When you say something like:
int i = 0, j = 1, k = 2;
The processor itself can execute these in parallel if there are available resources, because writes of literals to registers don't affect each other.
So even if parallelizing compilers only work for side-effect free portions of the language, that is still a decent portion of most code. If it weren't, then out-of-order execution wouldn't give much benefit, and all cpu's would have only one execution unit (instead of 3-4) - after all it only works on side-effect free portions too (more or less).
This is on a different level (fine grained instruction level vs. coarse grained module/function level) but I'm guessing the same arguments can still apply.