开发者

Is it possible to list all the threads currently running in .NET

I'd like to list as much information about all the threads currently running in .NET1.0 as I can. I don't have the luxury of adding threads to an inter开发者_JS百科nal list of my own when they get created; I just want to dump out a list of those that are currently in the system. Does any one know a way of doing this? I've been looking at the System.Threading... namespace and right now nothing is opening up as I hoped it would.


Don't know about 1.0 but in 1.1 you can use:

Process[] processlist = Process.GetProcesses();

If a Process's Modules collection contains mscoree.dll/mscorjit.dll, it is a .Net thread. The version of the .Net framework the application is running, can also be found by the information provided by the modules.


If you are able to break into the process, the .Net debugger will provide you with a list of all currently executing threads. It might also help you to know that provided you have a thread run through a code path you control, you can access it's thread object (System.Threading.Thread.CurrentThread) and give it a name, which you can then print out into any debugging messages. (Assuming .Net 1.0 has this...)

I know it's a lateral answer but it might help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜