With your explanation, I finally got that by "with defined EO, that func1() and func2() can be parallelised.", you actually mean "In some cases, it's possible to parallelize even with a defined EO, and give the user a well-defined result". In no way does an undefined EO prevent parallelization, as I've shown in another node. It merely frees the compiler/interpreter/CPU from the requirement to produce reproducible results if the subexpressions contain side effects.
Your "defined execution/evaluation order" cannot protect against side effects, even if you place semaphores everywhere, because IO or other deep/unprotected sideeffects will get in the way, unless you factually reduce the whole expression evaluation to a single thread. "defined execution/evaluation order" is the promise to the user that, no matter what, subexpression A will always be evaluated before subexpression B. Which obviously prevents parallelization.
Let's assume a simple order of execution of left-to-right. Your expression evaluation then obviously needs to perform all of func1, before it ever is allowed to enter func2, because it doesn't know what side effects func1 and func2 will share (assuming that a list of the side effects of both, func1 and func2 is not available before the two are called).
Your idea that "With defined EO, the programmer is explicitly indicating that any two functions (methods) that are marked as being parallelisable, that appear in the same statement, as co-operands to a non-serialising operation, can be parallelised." does in no part rely on the defined EO. If two pieces of code are marked as being parallelisable, then the only time you will notice the difference in the result is, if they are not actually parallelisable, because then the side-effects in the undefined EO can produce differing results in two executions of the program. With a defined EO, there can never be two differing results, because the program can effectively only be executed in a single path of execution.
In reply to Re^35: Why is EO undefined? (More details!)
by Corion
in thread Why is the execution order of subexpressions undefined?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |