Handle and Thread Count

December 6, 2006 at 22:11:13
Specs: Win NT, any

Anybody knows how to programmatically retrieve the handle count and thread count of the running process?
I mean, similar to the Task Manager, each process has its handle and thread counts opened.
I appreciate for your help guys. Thanks so much!

See More: Handle and Thread Count

June 24, 2007 at 14:05:02
All I know about how to get the thread counts is to instal the WinNT recource kit, open Wperf.exe, hit SELECT, and check Thread Count.

Hope this is helpful!


Report •

July 10, 2007 at 19:47:41

Windows NT 4.0 Service Pack 6a - NT Resource Kit

Report •

February 19, 2009 at 18:00:11
The easiest way to get the threads or handles used by a process is to first to get the process info and then retrieve the desired info as shown below -

Process appProcess = Process.GetProcessById(processId); // Can get process by name also
int threads = appProcess.Threads.Count;
int handles = appProcess.HandleCount;

As this information is a snapshot of the process, calling the Process.Refresh() method at desired intervals is required to get the latest counts.

Report •

Related Solutions

December 10, 2010 at 15:31:47
Down load Process explorer, its free. It will give you handles, threads, processes CSD, Interrupt Delta, DPC delta and processer live monitoring FW

Report •

Ask Question