Bob La Quey wrote:

Simple example. Say I have loop  that runs for M times. Say I have N
cores. Why not have the complier generate the code (including managing
memory) to run N loop  instances and thus run in approoximately 1/N the
time? So time to run goes from M to M/N mas o menos.

The reason would be that the loop might have side effects, and said side effects might impact subsequent iterations. This is one of the reason why languages like Haskell make the side effects clear. This allows you to do things like "compute all the non-side effect bits in parallel and then serialize the side effect bits", which you know is computationally equivalent to doing the whole thing sequentially.

--Chris

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to