public static void setThreadPoolCPUsFraction ( float fraction ) { setThreadPoolSize ( Math . max ( 1 , Math . round ( fraction * Runtime . getRuntime ( ) . availableProcessors ( ) ) ) ) ; }
Sets thread pool to a given fraction of the available processors .