What are Daemon threads and how can a thread be created as Daemon?

Q

.NET INTERVIEW QUESTIONS - What are Daemon threads and how can a thread be created as Daemon?

✍: Guest

A

Daemon thread's run in background and stop automatically when nothing is running program.
Example of a Daemon thread is "Garbage collector". Garbage collector runs until some .NET code is running or else its idle. You can make a thread Daemon by Thread.Isbackground=true.

2009-12-09, 9288👍, 0💬