How are scala 2.9 parallel collections working behind the scenes?
Scala 2.9 introduced parallel collections. They are a really great tool for certain tasks. However, I'm wondering how they work internally and if I'm able to influence the behavior/configuration.

What method do they use to figure out the optimal number of threads? If I am not satisfied with the result are there any configuration parameters to adjust?

I'm not only interested how many threads are actually created, I am also interested in the way how the actual work is distributed amongst them. How the results are collected and how much magic is going on behind the scenes if it is really worth the work of using different threads?
How are scala 2.9 parallel collections working behind the scenes?
===

Scala 2.9 introduced parallel collections. They are a really great tool for certain tasks. However, I'm wondering how they work internally and if I'm able to influence the behavior/configuration.

What method do they use to figure out the optimal number of threads? If I am not satisfied with the result are there any configuration parameters to adjust?

I'm not only interested how many threads are actually created, I am also interested in the way how the actual work is distributed amongst them. How the results are collected and how much magic is going on behind the scenes if it is really worth the work of using different threads?