I have been learning F# recently, being particularly interested in its ease of exploiting data parallelism. The data |> Array.map |> Async.Parallel |> Async.RunSynchronously
idiom seems very easy to understand and straightforward to use and get real value from.
So why is it that async
is not really intended for this? Donald Syme himself says that PLINQ and Futures are probably a better choice. And other answers I've read here agree with that as well as recommending TPL. (PLINQ doesn't seem too much different to the above built-in functions, as long as you're using the F# Powerpack to get the PSeq
functions.)
F# and functional languages make a lot of sense for this, and some applications have achieved great success with async
parallelism.
So why shouldn't I use async
to execute parallel data processes? What am I going to lose by writing parallel async
code instead of using PLINQ or TPL?