Quantcast
Channel: What is a daemon thread in Java? - Stack Overflow
Viewing all articles
Browse latest Browse all 28

Answer by Lunatic for What is a daemon thread in Java?

$
0
0

User threads versus Daemon threads in java threads

  • Daemon Threads

this threads in Java are low-priority threads that runs in the background to perform tasks such as garbage collection. Daemon thread in Java is also a service provider thread that provides services to the user thread.

  • User Threads

this threads are high-priority threads. The JVM will wait for any user thread to complete its task before terminating it

"keep in mind both User and Daemon threads wrapped upon OS threads"

Recently OpenJdk proposed Virtual threads with in project Loom (which they are User based as well) you may find more on Fibers and Continuations for the Java Virtual Machine threads in here.


Viewing all articles
Browse latest Browse all 28

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>