4 ms·
>Let me introduce you to my friend, Mister ConcurrentModificationException. He's a wily fellow-- he rarely pops up when you're doing local development, but he h
by seanmcdirmid 13y ago
>Let me introduce you to my friend, Mister ConcurrentModificationException. He's a wily fellow-- he rarely pops up when you're doing local development, but he has this nasty habit of showing up in production whenever you start hitting a decent load.
You do realize that concurrency and parallelization are very different topics right? One is a necessary property, the other is one of oppurtunity. It makes sense that collections designed for concurrency would suck at parallelism.
- mark242 13y agoHere is the magic of Scala. A collection designed for concurrency: val users = List("seanmcdirmid", "mark242").reverse That same collection, designed for parallelism and concurrency: val users = List("seanmcdirmid", "mark242").par.reverse
- seanmcdirmid 13y agoThe APIs are equivalent and safe, but parallelism is a feature of opportunity. The overhead of using an immutable collection is often not overcome by the use of parallel threads, making the tradeoff not worth it. Even CUDA has brought mutability back to GPUs for performance reasons.