Process.Threads Process.Threads Process.Threads Process.Threads Property

Definition

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

public:
 property System::Diagnostics::ProcessThreadCollection ^ Threads { System::Diagnostics::ProcessThreadCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Diagnostics.ProcessThreadCollection Threads { get; }
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.

Exceptions

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

-or-

The associated process has exited.

Remarks

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.

Security

LinkDemand
for full trust for the immediate caller. This member cannot be used by partially trusted code.

Applies to

See also