线程可以运行的最长时间?
我有一个 Web 服务,它创建一个线程来在后台处理一些数据。我在其中一个线程被终止的日志中看到一条“System.Threading.ThreadAbortException:线程正在中止”消息。我目前假设线程将运行只要执行它正在处理的任务所需的时间,但是在谷歌搜索异常之后,我看到了几篇文章提到增加网络中应用程序的 ExecutionTimeOut 属性。配置文件。我的问题是:
ASP.NET 中执行的线程的最大执行时间是多少?此超时是无限制的还是仍受应用程序的 ExecutionTimeOut 属性约束?
I have a web service that creates a thread to process some data in the background. I've seen a "System.Threading.ThreadAbortException: Thread was being aborted" message in one of my logs where the thread was killed. I am currently under the assumption that the thread will run as long as it takes to execute the tasks that it's working on, however after googling the exeception I've seen several posts making mention of increasing the ExecutionTimeOut property of the application in the web.config file. My question is:
What is the maximum execution time of a thread executed in ASP.NET? Is this timeout unlimited or still bound by the ExecutionTimeOut property of the application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个类似的问题。
如何知道谁杀死了我的线程
你可以运行它只要池正在运行。如果保留线程的池重新启动,那么它会等待所有线程退出,但运行页面的 Web 服务此时停止工作,并且您会遇到问题。另外,如果您已经设置了池,那么在池回收中,如果线程在一段时间后没有停止,则会将其杀死。
在我的程序中,一个索引线程运行了超过 26 小时,执行繁重的数据库工作,并且处于静态功能。
This is a similar question.
How to know who kills my threads
You can run it as long as the pool is running. If the pool thats keep the thread is restart then its wait for all the threads to exits, but the web service to run the pages stop working at this moment, and you have problems. Also if you have setup your pool then in pool recycle if the thread is not stop after some time its kill it.
In My program one index thread it was running for more than 26 hours doing hard database work, and was on static function.