码迷,mamicode.com
首页 > 编程语言 > 详细

Smart Thread Pool (智能线程池)

时间:2017-03-29 13:23:55      阅读:551      评论:0      收藏:0      [点我收藏+]

标签:sync   post   dll   log   bsp   pos   cal   exec   任务   

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);
      }
    }
  });
 
请先下载 SmartThreadPool.dll
 

Smart Thread Pool (智能线程池)

标签:sync   post   dll   log   bsp   pos   cal   exec   任务   

原文地址:http://www.cnblogs.com/newnj/p/6638863.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!