Gets the set of threads that are running in the associated process.
[Visual Basic] Public ReadOnly Property Threads As ProcessThread () [C#] public ProcessThread[] Threads {get;} [C++] public: __property ProcessThread* get_Threads(); [JScript] public function get Threads() : ProcessThread[];
An array of type ProcessThread that represents the operating system threads currently running in the associated process.
Exception Type | Condition |
---|---|
SystemException | The process does not have an Id, or there is no process associated with the Process instance.
-or- The associated process has exited. |
A thread executes code in a process. Each process is started with a single thread, its primary thread. Any of its threads can create additional threads. The total number of threads is determined by available RAM. 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 the thread at index zero in the array.
Process Class | Process Members | System.Diagnostics Namespace | ProcessThread | BasePriority