var tasks = new List<Task>(); for(int i=0;i<100;i++) { tasks.add(Task.Factory.StartNew(()=>action())); } task.waitall(tasks.Toarry());