Created
March 22, 2012 10:13
-
-
Save nschlimm/2157556 to your computer and use it in GitHub Desktop.
Custom thread pools
This file contains 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
ThreadPoolExecutor pool = | |
new ThreadPoolExecutor(0, 50, | |
60, TimeUnit.SECONDS, | |
new SynchronousQueue<Runnable>()); | |
pool.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); | |
ThreadPoolExecutor pool = | |
new ThreadPoolExecutor(50, 50, | |
0L, TimeUnit.MILLISECONDS, | |
new LinkedBlockingQueue<Runnable>(100000)); | |
pool.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment