1

I have a windows service which uses thread-pool in .net. When I configure maximum threads to be 1 in the thread pool I can still see more than one threads by using task manager for that service. What is the difference between these thread count?

Teoman Soygul
  • 25,584
  • 6
  • 69
  • 80
Jayantha Lal Sirisena
  • 21,216
  • 11
  • 71
  • 92
  • 3
    Take a look at [this thread](http://stackoverflow.com/questions/3476642/why-does-this-simple-net-console-app-have-so-many-threads) (pardon the pun) :) – dawebber Apr 28 '11 at 04:16

1 Answers1

1

The number of threads in use by your application is not under the control of the thread pool. There are numerous other things that will create threads in your application. The thread pool maintains a group of threads in addition to the ones used by your application directly.

Also, limiting thread pool threads to 1 is not a good idea. You may cause all sorts of problems plus it doesn't do what you think it is doing.

Talljoe
  • 14,593
  • 4
  • 43
  • 39