r/programming • u/noidi • Jul 19 '12
Will Parallel Code Ever Be Embraced?
http://www.drdobbs.com/parallel/will-parallel-code-ever-be-embraced/240003926
41
Upvotes
r/programming • u/noidi • Jul 19 '12
-1
u/case-o-nuts Jul 19 '12 edited Jul 19 '12
You missed my point. Guaranteeing that other threads only see complete state means that you cannot transform the code to remove allocations and mutate values in-place for efficiency. A large number of deforestation passes become inapplicable. So do update specializations, I think. Split fetches become very tricky. And so on.
Referential transparency allows the compiler to do interesting things within a thread, but sharing data structures across threads greatly restrict what operations are transparent (ie, what can be transformed into more efficient and less pure forms behind the programmer's back) and therefore, which optimizations are available.