Parallel.Invoke(() =>
{
Debug.WriteLine("task1 start");
// NOTE:すごい時間のかかる処理をしているつもり
new Task(() => { }).Wait(1000);
Debug.WriteLine("task1 end");
},
() =>
{
Debug.WriteLine("task2 start");
// NOTE:すごい時間のかかる処理をしているつもり
new Task(() => { }).Wait(1000);
Debug.WriteLine("task2 end");
});
出力:
task2 start
task1 start
task2 end
task1 end
tasks finished