问题描述
如果我一个ASP.NET页面上创建一个新的线程在 IsThreadPoolThread
属性为true。
第一个问题是,它与ASP.NET池或CLR池?
第二个问题是,如果是从ASP.NET池,然后将如何从CLR线程,并且不使用ASP.NET池?
我需要长时间运行的请求的同步解决方案(full故事)。
If I create a new thread on an ASP.NET page the IsThreadPoolThread
property is true.First question is, is it from ASP.NET pool or CLR pool ?Second question is, if it is from ASP.NET pool then how to create a thread from CLR and don't use ASP.NET pool ?I need a synchronous solution for long-running requests (full story).
推荐答案
首先,有ASP.NET线程池和CLR线程池之间没有差别。 ASP.NET处理的CLR线程池的网页,所以你的ASP.NET页面将永远有IsThreadPoolThread ==真。
First off, there is no difference between the ASP.NET thread pool and the CLR thread pool. ASP.NET processes pages on the CLR thread pool, so your ASP.NET pages will always have IsThreadPoolThread == true.
我很好奇,你是如何创建的线程。您是否使用System.Threading.Thread构造函数,或者你使用ThreadPool.QueueUserWorkItem?如果你正在使用ThreadPool.QueueUserWorkItem,那么你所得到的线程是从普通的.NET线程池来了。
I'm curious as to how you are creating your thread. Are you using the System.Threading.Thread constructor, or are you using ThreadPool.QueueUserWorkItem? If you are using ThreadPool.QueueUserWorkItem, then the threads that you are getting are coming from the regular .net thread pool.
最后,因为我有
这篇关于如何从CLR线程池,而不是ASP.NET池ASP.NET页面创建线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!