Smart Thread Pool (智能线程池)
STPStartInfo stp = new STPStartInfo();
stp.DisposeOfStateObjects = true;
stp.CallToPostExecute = CallToPostExecute.Never;
stp.ThreadPriority = ThreadPriority.Highest;
stp.UseCallerCallContext = true;
stp.MaxWorkerThreads = 4;
//职能线程池
var smartThreadPool = new SmartThreadPool();
// 执行任务
smartThreadPool.QueueWorkItem(() =>
{
//加载需要处理的数据
log.InfoFormat("@-->Excete 数据条数{0}", asyncCalls.Count);
if (asyncCalls != null && asyncCalls.Count > 0)
{
foreach (var item in asyncCalls)
{
ExecuteService.ExecuteItem(item);
}
}
});