Created
March 13, 2017 10:18
-
-
Save netopyr/e648d5600180c64a72a71cd66ce6ece1 to your computer and use it in GitHub Desktop.
Example where a cached-thread-pool prevents immediate exit of the application
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
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class CachedThreads { | |
public static void main(String[] args) { | |
final ExecutorService executor = Executors.newCachedThreadPool(); | |
executor.submit(() -> System.out.println("Hello World")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment