Get All threads

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
 
A

Allen Jones

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
 
D

Dave

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top