摘要:
Threadpool线程池和泛型List,实现同样功能的多线程的例子。
下载原代码
Code:
using System;
using System.Threading;
using System.Collections.Generic;
public class OprateClass
{
public OprateClass( ManualResetEvent doneEvent)
{
_doneEvent = doneEvent;
}
// Wrapper method for use with thread pool.
public void ThreadPoolCallback(Object threadContext)
{
int threadIndex = (int)threadContext;
Console.WriteLine("Thread parameter:{0}", threadIndex) 阅读全文