Q1. What is the minimum number of threads that used to
run in any .Net application?
A: There should be at least two threads running in a
.net application. They are the main thread and the GC (Garbage collector).
Q2. What is Suspend and Resume in threading?
A: Suspend allows you to block a thread until another
thread calls Thread.Resume.
Q3. Differentiate between Thread.Sleep and
Thread.Suspend?
A: The difference among these two is the later does
not put the process in a waiting state immediately. The process gets suspended
if the .net runtime determines that it is a safe place to suspend the process.
Q4. What is Daemon Thread?
A: Daemon threads run in the background. An example
is a Garbage Collector (It runs until the .NET code runs or otherwise it
becomes idle).
Q5. While executing Thread1, if we call Thread2..Join(),
what will happen?
A: Here Thread1 will wait until Thread2 completes the
execution and then invokes Thread1 again.