在4.0 下的并行开发

 并行开发/运行 

 

public void ParalleTest()
        {
            //invoke,for和forEach。


            Parallel.Invoke(CheckOrder, CheckOrder);


             Parallel.For(0, 20000000, i =>      
            {
                // do sth
                    
            });

             Parallel.ForEach(Partitioner.Create(0, 20000000), i =>
             {
                 for (int m = i.Item1;  m < i.Item2; m++)
                 {
                    // do sth
                 }
             });
        }

posted @ 2012-05-23 15:24  咸鱼公子  Views(293)  Comments(0Edit  收藏  举报