本笔记只作为学习标识,对代码不作注释!
代码下载:下载
使用方
protected void Button_Click(object sender, EventArgs e) { var dealThread = new DealThread(); dealThread.Pool(3); dealThread.DealFunction(Func);//可以去掉使用内部的处理方法 ThreadInfo.SetProxy(dealThread); } protected void Button1_Click(object sender, EventArgs e) { ThreadInfo.Run(); } protected void Button3_Click(object sender, EventArgs e) { for (int i = 0; i < 4000; i++) { ThreadInfo.AddItem(new ItemEntity() { Message = i.ToString() }); } } protected void Button2_Click(object sender, EventArgs e) { ThreadInfo.Stop(); } private void Func(ItemEntity itemEntity) { }