Demon Thread

 Demon Thread: It is a thread which is of less priority. we can make any thread as demon thread except main thread. by default all  the threads are non-demon. If we make the main thread as demon it will throw illegal exception.

Example of Demon thread is Garbage collector. Garbage collector usually cleans the Heap/Unallocated heap area when no one is referring to it. In that case JVM will automatically set it as high priority and cleans the Heap area. If in case if it is referring then JVM will make it as demon thread which is of low priority.

Comments

Popular posts from this blog

Advantages and Disadvantages of Monolithic Architecture

Monolithic Architecture

Eclipse debugging