开发者

How can I add more threads to the forkjoinpool

开发者 https://www.devze.com 2023-01-03 05:22 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消