Scala 2.9 RC1 released


The main feature is the addition of parallel collections to the standard library:


Every collection may be converted into a corresponding parallel collection with the new `par` method. Parallel collections utilize multicore processors by implementing bulk operations such as `foreach`, `map`, `filter` etc. in parallel. Parallel collections are located in the package `scala.collection.parallel`.

Depending on the collection in question, `par` may require copying the underlying dataset to create a parallel collection. However, specific collections share their underlying dataset with a parallel collection, making `par` a constant time operation.

Currently available parallel collections are:

  • parallel arrays - scala.collection.parallel.mutable.ParArray
  • parallel ranges - scala.collection.parallel.immutable.ParRange
  • parallel hash maps - scala.collection.parallel.mutable.ParHashMap
  • parallel hash sets - scala.collection.parallel.mutable.ParHashSet
  • parallel hash tries - scala.collection.parallel.immutable.{ParHashMap, ParHashSet}
  • parallel vectors - scala.collection.parallel.immutable.ParVector

The method `seq` is used to convert from a parallel collection to a corresponding sequential collection. This method is always efficient (O(1)).