I recently su开发者_StackOverflowccessfully experimented with Scala futures. I'm pleased as punch with the gains I'm seeing from the parallelism, but I'm only seeing 4 worker threads.
I've been looking all over for how I can crank up the number of threads to 11, but no luck. How can I do this?
Check out the source at http://www.scala-lang.org/api/current/index.html#scala.actors.scheduler.ResizableThreadPoolScheduler
There are some system properties: actors.corePoolSize and actors.maxPoolSize. Looks you can adjust those, and the scheduler for daemon-like things (including futures) will get a larger number. By default it picks up on the number of processors, I guess.
精彩评论