Created
March 22, 2012 10:14
-
-
Save nschlimm/2157558 to your computer and use it in GitHub Desktop.
Use PoolSizeCalculator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyPoolSizeCalculator extends PoolSizeCalculator { | |
public static void main(String[] args) throws InterruptedException, | |
InstantiationException, | |
IllegalAccessException, | |
ClassNotFoundException { | |
MyThreadSizeCalculator calculator = new MyThreadSizeCalculator(); | |
calculator.calculateBoundaries(new BigDecimal(1.0), | |
new BigDecimal(100000)); | |
} | |
protected long getCurrentThreadCPUTime() { | |
return ManagementFactory.getThreadMXBean().getCurrentThreadCpuTime(); | |
} | |
protected Runnable creatTask() { | |
return new AsynchronousTask(0, "IO", 1000000); | |
} | |
protected BlockingQueue<Runnable> createWorkQueue() { | |
return new LinkedBlockingQueue<>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment