Get All threads

  • Thread starter Thread starter WinstonSmith
  • Start date Start date
W

WinstonSmith

Hallo everyone,

is there a way to get a list of all threads an application written in C#
uses?

Thanks in advance

Matthias
 
Matthias,

You can use the Process.Threads property to get a collection of
ProcessThread objects that represent the operating system threads in a
process.

Regards
Allen
 
Do not stop threads retrieved by Process.Threads - those are operating
system threads, not CLR managed threads. There is no call that allows you to
retrieve a list of all managed threads. Instead, you must keep track of all
the threads that your application has created.

There are three managed threads created when you start a managed
application - the main thread, the GC thread, and a thread used to run
finalizers.
 
Back
Top