ExecutorService vs Casual Thread Spawner
I have a basic question about how ExecutorService works in Java. It is quite hard to see the difference between simply creating Threads to perform some tasks in parallel and assigning each tasks to the ThreadPool . The ExecutorService also looks very simple and efficient to use, so I was wondering why we don't use it all the time. Is it just a matter of one way executing its job faster than the other ? Here's two very simple examples to show the difference between the two ways : Using executor service: Hello World (task) static class HelloTask implements Runnable { String msg; public HelloTask