09 May 2013

Minimum threads in .NET Application

What is the bare minimum number of threads will be running in .NET application?. This is a .NET interview question.

To answer this question, first let's try to understand what all different thread will be there in any .net application or .NET process.

Below are the different threads could running in any .NET process or .NET application:

  • Main thread or UI thread.
  • Any worker threads created.
  • .NET garbage collection thread.

Worker threads will be there in the .NET process, depending on the logic you have created. Main/UI thread and .NET garbage collection thread will always be running in any .NET process or .NET application.

So, to answer the interview question, there will always be minimum of two thread will be running in .NET application.