IIS自动关闭

Xiaoyuan245437 2010-09-29 12:06:51
     var StartTime = DateTime.Now;

IList<abc> listProduct = bll.GetAllInfoByGIA();
int succNum;
var count = listProduct.Count / 5;
var num1 = 0;
System.Threading.Thread thread1 = new System.Threading.Thread(delegate()
{
//执行抓取方法;
for (int i = 0; i < count; i++)
{
num1 += GatherGIA(listProduct[i]);
}

});
thread1.Start();
var num2 = 0;
System.Threading.Thread thread2 = new System.Threading.Thread(delegate()
{
//执行抓取方法;
for (int i = count; i < 2 * count; i++)
{
num2 += GatherGIA(listProduct[i]);
}
});
thread2.Start();
var num3 = 0;
System.Threading.Thread thread3 = new System.Threading.Thread(delegate()
{
//执行抓取方法;
for (int i = 2 * count; i < 3 * count; i++)
{
num3 += GatherGIA(listProduct[i]);
}
});
thread3.Start();
var num4 = 0;
System.Threading.Thread thread4 = new System.Threading.Thread(delegate()
{
//执行抓取方法;
for (int i = 3 * count; i < 4 * count; i++)
{
num4 += GatherGIA(listProduct[i]);
}
});
thread4.Start();
var num5 = 0;
System.Threading.Thread thread5 = new System.Threading.Thread(delegate()
{
//执行抓取方法;
for (int i = 4 * count; i < listProduct.Count; i++)
{
num5 += GatherGIA(listProduct[i]);
}
});
thread5.Start();
while (true)
{
if (thread1.ThreadState != System.Threading.ThreadState.Stopped) continue;
if (thread2.ThreadState != System.Threading.ThreadState.Stopped) continue;
if (thread3.ThreadState != System.Threading.ThreadState.Stopped) continue;
if (thread4.ThreadState != System.Threading.ThreadState.Stopped) continue;
if (thread5.ThreadState != System.Threading.ThreadState.Stopped) continue;
break;
}
thread1.Abort();
thread2.Abort();
thread3.Abort();
thread4.Abort();
thread5.Abort();


为应用程序池 'L' 提供服务的进程关闭时间超过了限制?

我想知道 是不是上面的代码造成的??

...全文
119 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Xiaoyuan245437 2010-09-30
  • 打赏
  • 举报
回复
我问的 是 上面那个抓取方法 对应用程序池 'DefaultAppPool'有什么影响没??
Xiaoyuan245437 2010-09-29
  • 打赏
  • 举报
回复
  • 打赏
  • 举报
回复
木有人!
yingying164399 2010-09-29
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 wuyq11 的回复:]
查看设置
查看应用程序池->DefaultAppPool属性
注册表HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC
UseSharedWPDesktop
或用ThreadPool.QueueUserWorkItem执行
[/Quote]
值得借鉴
wuyq11 2010-09-29
  • 打赏
  • 举报
回复
查看设置
查看应用程序池->DefaultAppPool属性
注册表HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC
UseSharedWPDesktop
或用ThreadPool.QueueUserWorkItem执行

62,272

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧