NUMBER OF THREADS

  • Thread starter Thread starter Sugandh Jain
  • Start date Start date
S

Sugandh Jain

Hi,

I am confused about the number of threads getting used when I run a desktop
application where multiple forms open up from different dlls used in the
project.

do they open on single thread or multiple forms open on the same UI thread.

Regards,
Sugandh Jain
 
There is 1 main thread since WinForms run in single-threaded apartment
state. Depending on your program you can have off course multiple foreground
and/or background threads. Threads in the threadpool are limited to 25
threads per CPU core. When you create threads you are limited by memory
which on 32-bit systems cannot exceed 2GB unless you specify the 3GB boot
option. Using performance counters you can monitor the number of active
threads in your process. Just start perfmon and then Performance Object .NET
CLR Locks And Threads.

Gabriel Lozano-Morán
 
Back
Top