User Tools

Site Tools


java:threadpoolexecutor

This is an old revision of the document!


ThreadPoolExecutor

This class is used to execute tasks in Java. Generally, users will not directly create a ThreadPoolExecutor, but instead use one of the the static factory methods in `Executors` to create one. For example:

  1. class Runner {
  2.  
  3. private final ExecutorService executor = Executors.newCachedThreadPool();
  4.  
  5. public void run(Runnable r) {
  6. executor.execute(r);
  7. }
  8. }
java/threadpoolexecutor.1740208846.txt.gz · Last modified: by carl