Multicore programming with ClojureThis is really just a blurb, not a serious introduction or set of examples. A few months ago I wrote about how I prefer Python's map() to using its List Comprehensions feature even if list comprehensions look and feel more Pythonic. The main reason is because by using map, it makes it simple to extend functional code to multiple cores or machines without changing the original, just by writing a clever version of the map function.
Clojure has such a clever version built-in, called pmap. Basically, it works just like map but applies the mapper function to the input dataset in parallel. (Hence it really shines when the mapper function time dominates.) I just wanted to gush over how awesome it is. Clojure also includes a time macro that makes benchmarking easy. Check out the docs here for an example.
Posted on 2011-10-23 by Jach
Tags: clojure, fodder, programming
Trackback URL: https://www.thejach.com/view/2011/10/multicore_programming_with_clojure