Paralell collections in Scala

2,969
-1

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,969
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
29
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Paralell collections in Scala

  1. 1. Parallel collections i Scala 2.9 Alf Kristian Støyle Know IT Objectnet
  2. 2. http://www.nassaulibrary.org/ncla/nclacler_files/LILC7.JPG
  3. 3. http://schoolchat.wordpress.com/2008/04/22/keeping-pollution-levels-low/
  4. 4. Embarrassingly parallel
  5. 5. Fork/Join
  6. 6. Work stealing
  7. 7. Double-ended queue - deque
  8. 8. Double-ended queue - deque
  9. 9. Double-ended queue - deque
  10. 10. val persons: List[Person] = ...val (kids, adults) = persons.partition(_.age < 18)
  11. 11. val paralellList = List(1, 2, 3).par
  12. 12. val paralellList = List(1, 2, 3).parval sequentialList = paralellList.seq
  13. 13. • 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 http://www.scala-lang.org/node/8976
  14. 14. REPL demo(https://gist.github.com/919224)
  15. 15. Q &A

×