c# ThreadPool 应用实例
来源:互联网 发布:淘宝商城招商 编辑:程序博客网 时间:2024/06/13 22:22
namespace ThreadPoolTestCase{ class Program { static void Main(string[] args) { for (int i = 0; i < 10000; i++) { int state = i; AssignWork(state); Console.WriteLine(i); } Console.ReadKey(); } public static void AssignWork(object s) { ThreadPool.QueueUserWorkItem(new WaitCallback(DoWork), (object)s); Console.WriteLine(s); //wait.Reset(); } private static void DoWork(object o) {//may be smtp works here; Console.WriteLine("abcdef"); for (int i = 0; i < 100000; i++) { Console.WriteLine("abcdef"); Thread.Sleep(1000); } // } }}
0 0
- c# ThreadPool 应用实例
- 线程池 ThreadPool 概念、应用实例
- C# ThreadPool
- C# ThreadPool
- ThreadPool用法实例
- C#ThreadPool.QueueUserWorkItem实例
- C# 中的 ThreadPool
- C# ThreadPool类简介
- C# ThreadPool学习笔记
- C# ThreadPool 的改进
- C#线程池ThreadPool
- C# ThreadPool 线程同步
- C# ThreadPool理解
- C#钩子应用实例
- C# 接口 应用实例
- C#事件应用实例
- C#钩子应用实例
- C# Tutorial - Using The ThreadPool
- 对类的理解
- 发来的卡夫卡法规和共和国
- 使用CStdioFile 读写UNICODE文档
- 今天第一次写博客,先不说技术了
- nodejs使用express,crypto配合validator实现用户登录逻辑
- c# ThreadPool 应用实例
- 2014华为机试-在字符串中找出连续最长的数字串
- 命名空间
- Split a string using String.split()Tag(s): String/Number
- http://blog.csdn.net/xiaanming/article/details/9401981
- linux 同步时间
- c++ 求解数列最大的两个子段和
- leetcode Interleaving String
- STL 各种容器 比较函数重写