Process.Threads Property


Gets the set of threads that are running in the associated process.

 property System::Diagnostics::ProcessThreadCollection ^ Threads { System::Diagnostics::ProcessThreadCollection ^ get(); };
public System.Diagnostics.ProcessThreadCollection Threads { get; }
public System.Diagnostics.ProcessThreadCollection Threads { get; }
member this.Threads : System.Diagnostics.ProcessThreadCollection
member this.Threads : System.Diagnostics.ProcessThreadCollection
Public ReadOnly Property Threads As ProcessThreadCollection

Property Value

An array of type ProcessThread representing the operating system threads currently running in the associated process.



The process does not have an Id, or no process is associated with the Process instance.


The associated process has exited.


The value returned by this property represents the most recently refreshed threads. To get the most up to date information, you need to call Refresh() method first.

A thread executes code in a process. Each process is started with a single thread, its primary thread. Any thread can create additional threads. Threads within a process share the address space of the process.

Use ProcessThread to get all the threads associated with the current process. The primary thread is not necessarily at index zero in the array.

Applies to

See also