我怎么能枚举在C#中的所有托管线程? [英] How can I enumerate all managed threads in C#?

查看:105
本文介绍了我怎么能枚举在C#中的所有托管线程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能枚举在C#中的所有托管线程? Visual Studio的似乎是能够做到这一点,当你打一个破发点,同时调试。在新语丝窗口,它显示了所有正在运行的线程,包括管理的名单。有谁知道它是如何做到这一点?

Is it possible to enumerate all managed threads in C#? Visual Studio seems to be able to do this when you hit a break point while debugging. In the "Threads" window it shows a list of all running threads, including managed names. Does anyone know how it does this?

推荐答案

调试器往往能够做的事情正常code不能。你可能会发现,你可以做,如果你使用分析/调试API,但我不相信你可以从正常。NET code做到这一点。

Debuggers are often able to do things "normal" code can't. You'd probably find that you can do this if you use the profiling/debugging API, but I don't believe you can do it from "normal" .NET code.

这篇关于我怎么能枚举在C#中的所有托管线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆