I've used the ThreadPool.GetAvailableThreads to monitor the thread usage in a web site, and written the results to a performance counter. To do this, I've had a thread running in the site that does the monitoring. I'd like to be able to monitor this wit开发者_JAVA技巧hout modifying sites' code. Is there a way I can write a console app that would be able to access the thread pool of a given process, rather than the current process, and call GetAvailableThreads for that pool?
Sure. Have a look at this: http://msdn.microsoft.com/en-us/library/ff650682.aspx The information is deprecated because IIS 7 implements ASP.NET app pooling (and thus thread pooling) a different way, but if you use a "Classic .NET App Pool" it should still work.
精彩评论