Threads, executors and ending a "hanging" main method
Joined: Aug 04, 2012
The following code is from a tutorial on multithreading (meant to introduce the CountDownLatch and incorporating a thread pool). When it's run, it just "hangs" at the end. If it wasn't using the thread pool it would use thread objects and the join() method could be called on each thread from the main thread and, presumably, the main thread would end when the other threads end. But what do you do to end the main thread when a thread pool is used and why does the main thread not just end after the last line of the main method anyway?
The ouptput is:
...And cursor just sits at the end blinking and unresponsive.