Search code examples
javamultithreadingdaemonjava.util.concurrentfork-join

Daemon threads in ForkJoinPool


According to Java Doc 7:

Because ForkJoinPool uses threads in daemon mode, there is typically no need to explicitly shut down such a pool upon program exit

Are there no other advantages? Is a daemon thread only different from a normal thread in "alive until the system is alive"? Does it only mean I don´t have to care about shutting down the ForkJoinPool?

Can someone clear me up?


Solution

  • Daemon has very little affect in Java. If you don't shut down the pool, then you will not recover all the memory it uses. That includes the threads.