The OCaml GC imposes a global lock that prevents mutators (threads) from running in parallel although they can run concurrently (interleaved). I believe the same is true of SML/NJ and MLton but not PolyML, GHC, F#, Clojure and Scala.
What other functional language implementations allow threads to run in parallel?
In the same multithreaded process in a shared-memory multiprocessor environment, each thread in the process can run concurrently on a separate processor, resulting in parallel execution, which is true simultaneous execution.
Efficient Parallel Programming − Functional programming languages have NO Mutable state, so there are no state-change issues. One can program "Functions" to work parallel as "instructions". Such codes support easy reusability and testability.
Parallel functional programming refers to a specific philosophy of computer science that uses functional programming in conjunction with parallelism to work with declarative programming in specific ways.
2.1. Within a Java application you work with several threads to achieve parallel processing or asynchronous behavior. Concurrency promises to perform certain task faster as these tasks can be divided into subtasks and these subtasks can be executed in parallel.
There are a number of good implementations out there. At the moment, the Haskell people seem to be getting the best results (see ICFP 2009 paper by Simon Marlow and others as well as Haskell Symposium 2009 paper by Donnie Jones and others). Erlang is quite close behind, especially if you want to go distributed.
In six to twelve months the answers may have changed :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With