Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the GPars default pool size?

I thought this would have been an easy thing to find but I've failed.

If I use GPars in my Groovy application and I don't specify a pool size how many threads will be created? Is there a default pool size without setting one?

// How many threads will be created? What is the default pool size?
GParsExecutorsPool.withPool {
    // do stuff...
}
like image 809
C0deAttack Avatar asked Jan 12 '12 17:01

C0deAttack


1 Answers

It is (by default) set to

private static int defaultPoolSize() {
  return Runtime.getRuntime().availableProcessors() + 1;
}

You can alter this (I believe) by setting a System property called gpars.poolsize to a valid Integer

like image 125
tim_yates Avatar answered Sep 23 '22 00:09

tim_yates