?????????????????????????????????????????У?????????в???????????С??????в??????????÷?????
????static void Main(string[] args)
????{
????Thread oThread = new Thread(new ParameterizedThreadStart(Test2));
????oThread.IsBackground = true;
????oThread.Start(1000);
????}
????private static void Test2(object Count)
????{
????for (var i = 0; i < (int)Count; i++)
????{
????Console.WriteLine("?????????" + i);
????//Thread.Sleep(100);
????}
????}
?????????в????з????????У?????????new Thread()??????????н?????????????????в????з????????п??????????????
????public delegate string MethodCaller(string name);
????//?????????
????MethodCaller mc = new MethodCaller(GetName);
????string name = "my name";
????//???????
????IAsyncResult result = mc.BeginInvoke(name??null?? null);
????string myname = mc.EndInvoke(result);
????//???????????
????public string GetName(string name)
????// ????
????{
????return name;
????}
?????????????????м?????????????
??????Thread oGetArgThread = new Thread(new ThreadStart(Test));
????oGetArgThread.Join();//???????????????????????н????????????????????????????????????????????Ч??
??????????????????????Thread?????Priority???????????Priority?????????????
public enum ThreadPriority
{
// ??:
//     ????? System.Threading.Thread ??????????κ??????????????????
Lowest = 0??
//
// ??:
//     ????? System.Threading.Thread ????????? Normal ?????????????????? Lowest ??????????????
BelowNormal = 1??
//
// ??:
//     ????? System.Threading.Thread ????????? AboveNormal ?????????????????? BelowNormal ??????????????
//     ???????£??????? Normal ???????
Normal = 2??
//
// ??:
//     ????? System.Threading.Thread ????????? Highest ?????????????????? Normal ??????????????
AboveNormal = 3??
//
// ??:
//     ????? System.Threading.Thread ??????????κ???????????????????
Highest = 4??
}
??????0??4??????????????
?????????????????????????????????????????????????????????????????????????.Net??????lock?????????
????private static object oLock = new object();
????private static void Test2(object Count)
????{
????lock (oLock)
????{
????for (var i = 0; i < (int)Count; i++)
????{
????Console.WriteLine("?????????" + i);
????//Thread.Sleep(100);
????}
????}
????}
??????2??Task???????????????????????????????????????????????????????????????????£?
????List<Task> lstTaskBD = new List<Task>();
????foreach (var bd in lstBoards)
????{
????var bdTmp = bd;
????//????????????????????
????var oTask = Task.Factory.StartNew(() =>
????{
????var strCpBdCmd = "rm -Rf " + bdTmp.Path + "/*;cp -R " + CombineFTPPaths(FTP_EMULATION_BD_ROOT??
????"bd_correct") + "/* " + bdTmp.Path + "/";
????oPlink.Run(bdTmp.EmulationServer.BigIP?? bdTmp.EmulationServer.UserName?? bdTmp.EmulationServer.Password??
????strCpBdCmd);
????Thread.Sleep(500);
????});
????lstTaskBD.Add(oTask);
????}
????Task.WaitAll(lstTaskBD.ToArray());
????//??????????????????
????????????????????????????? var bdTmp = bd;?????????????????????????????bd??????????????????????????????????????????????????????????Task??????÷???????????????漰????????????????????????????Щ?????????????????????