Skip to content

Instantly share code, notes, and snippets.

@wakim
Created February 17, 2016 20:13
Show Gist options
  • Select an option

  • Save wakim/4b9b9907afb6b42ac778 to your computer and use it in GitHub Desktop.

Select an option

Save wakim/4b9b9907afb6b42ac778 to your computer and use it in GitHub Desktop.
ExecutorService executor = Executors.newFixedThreadPool(5);
for (int i = 0; i < 10; ++i) {
executor.execute(new MyTask());
}
executor.shutdown();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment