线程可以运行的最长时间?

发布于 2024-08-31 23:31:36 字数 272 浏览 4 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一张白纸 2024-09-07 23:31:36

这是一个类似的问题。

如何知道谁杀死了我的线程

你可以运行它只要池正在运行。如果保留线程的池重新启动,那么它会等待所有线程退出,但运行页面的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文