手头一个项目中,使用到多线程例, 分配任务, 处理任务,显示任务状态,等.
下面的代码就是一个样例. 供大家参考.
- /* By shelly<mrshelly at hotmail.com> */
- using System;
- using System.Threading;
- using System.Collections;
- namespace shareThread{
- class MyThread{
- static Queue q1=new Queue();
- static int b=0;
- int thState = 3;
- public