January 2018
Beginner
426 pages
10h 4m
English
The ParArray constructor is the parallel implementation of ArraySeq, and holds elements in a linear fashion. It resides in the scala.collection.parallel.mutable package. To create a parallel array, we can import this package as follows:
scala> import scala.collection.parallel.mutable._ import scala.collection.parallel.mutable._ scala> val pararr = ParArray(1,2,3,4,5,6,7,8,9,10) pararr: scala.collection.parallel.mutable.ParArray[Int] = ParArray(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
Here, we have created a parallel array named pararr by simply using the ParArray constructor, with elements passed as arguments. For demonstration purposes, we're using a limited number of elements in our implementation, but it's obvious we would like parallel ...
Read now
Unlock full access