Caveats of parallel collections
Parallel collections were designed to provide a programming API similar to sequential Scala collections. Every sequential collection has a parallel counterpart and most operations have the same signature in both sequential and parallel collections. Still, there are some caveats when using parallel collections, and we will study them in this section.
Parallel collections use
splitters, represented with the
Splitter[T] type, in order to provide parallel operations. A splitter is a more advanced form of an iterator; in addition to the iterator's
hasNext methods, splitters define the
split method that divides the splitter
S into a sequence of splitters that traverse parts of