With Scala Parallel Collections, which will be included in 2.8.1, you can do things like this:
val spliced = myList.par // obtain a parallel version of your collection (all operations are parallel) spliced.map(process _) // maps each entry into a corresponding entry using `process` spliced.find(check _) // searches the collection until it finds an element for which // `check` returns true, at which point the search stops, and the element is returned
and the code will automatically execute in parallel. Other methods found in the regular collection library are also parallelized.
Currently 2.8.RC2 is very close (this or next week) and the 2.8 finals will come a few weeks after, I think. You can try parallel collections if you use the night watch 2.8.1.
source share