SmartThreadPool线程进入循环时出错. [英] SmartThreadPool Error while going the threads in loop.
本文介绍了SmartThreadPool线程进入循环时出错.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用SmartThreadPool的项目.我有一个IP列表以获取DNS名称.我从dataTable的dataBase中获取IP列表.如果该表包含1个IP,则以下代码执行得很好,没有错误.如果表包含多个IP,则以下代码将引发错误,提示
I have a project with SmartThreadPool.I have a list of IPs to get DNS Names.I get list of IPs from dataBase in a dataTable.If the table contains 1 IP means The below code executes well no error. If the table Contains more than 1 IP means The below code throw an error saying that
"The SmartThreadPool has been shutdown\Object name: ''SmartThreadPool.Internal.WorkItemsQueue"
这是我使用的代码.
This is the code that I have used.
for(int i=0;i<=dt.rows.count;i++
{
sd.OnPing += new PingDelegate(OnHostPing);
_hosts.Add(sd);
iWorkItemsGrp.QueueWorkItem(new WorkItemCallback(sd.Start), new object());
}
推荐答案
您是否使用此工具:智能线程池 [ ^ ].
如果是这样,请在本页底部询问本文的作者.
—SA
Do you use this: Smart Thread Pool[^].
If so, ask the author of this article, at the bottom of this page.
—SA
这篇关于SmartThreadPool线程进入循环时出错.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文