public final class ThreadPoolUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
getCpuIntensivePoolSize()
A cpu-intensive task has a blocking coefficient of 0.
|
static int |
getIoIntensivePoolSize() |
static int |
getIoIntensivePoolSize(double blockingCoefficient)
Each task blocks 90% of the time, and works only 10% of its
lifetime, that is I/O intensive pool, io-intensive task has a value close to 1
|
static int |
poolSize(double blockingCoefficient)
Number of threads = Number of Available Cores / (1 - blockingCoefficient)
|
public static int getCpuIntensivePoolSize()
public static int getIoIntensivePoolSize()
public static int getIoIntensivePoolSize(double blockingCoefficient)
public static int poolSize(double blockingCoefficient)
blockingCoefficient - the coefficientCopyright © 2022. All rights reserved.