Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. ThreadPoolExecutor executor = new ThreadPoolExecutor(
  2. 0, // core threads
  3. 10, // max threads
  4. 2000, TimeUnit.MILLISECONDS,
  5. new LinkedBlockingQueue<Runnable>(),
  6. Executors.defaultThreadFactory()
  7. );
  8.  
  9. ThreadPoolExecutor executor = new ThreadPoolExecutor(
  10. 10, // core threads
  11. 10, // max threads
  12. 2000, TimeUnit.MILLISECONDS,
  13. new LinkedBlockingQueue<Runnable>(),
  14. Executors.defaultThreadFactory()
  15. );
  16.  
  17. executor.allowCoreThreadTimeOut(true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement