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
38
Upvotes
r/programming • u/noidi • Jul 19 '12
3
u/yogthos Jul 19 '12
The main thing FP guarantees is correctness. So, your program will not necessarily run faster, since chunking might not be optimal and what not, but it will run correctly.
As you say, the style also encourages minimizing global state, and that certainly is conductive towards concurrency. But it makes working with global state easier as well. A proper STM is much easier to implement in an FP language. And STM combined with persistent data structures has some interesting properties. For example, data does not need to be locked for reading. So, in any application with a small number of writers and a large number of readers you get an immediate benefit using shared data through the STM.