By using this site, you agree to our Privacy Policy and our Terms of Use. Close
Soleron said:
NJ5 said:
This will probably just improve the loops which are embarassingly parallel... Any real-time or performance-critical application would already have the most important loops parallelized.

And of course it will only work if the functions called in the loop are purely functional (i.e. not accessing volatile or global variables, and only calling equally clean functions).

Still pretty cool but nothing revolutionary, this optimization is just picking the low-hanging fruit. The real optimizations lie in fundamentally restructuring programs around the idea of multi-core, which is where it gets hard or impossible to do.

Well, I'm not an expert, so I'll agree with you.

Could there be any sort of compiler-level software in the future that could do that restructuring?

 

That kind of restructuring would require human-level (or above) AI, generally speaking. At that point we will probably not be using compilers, since our AI friends will be writing programs for us (if they don't exterminate us of course).

There are languages more suited to automatic parallelization than C, I'd imagine that most C programs have loops which this compiler trick won't touch due to having potential side effects that the compiler can't reason about (so it will assume it's too dangerous to do parallelization). I can provide simple examples if anyone is interested.

Still this is useful in that it will make code more readable, and automate some of the work behind making loops parallel. This makes for faster programming and less bugs.

 



My Mario Kart Wii friend code: 2707-1866-0957