i have an async Task like this:
public async Task DoWork()
{
}
And i have at the moment a:
List<Task> tmp = new List<Task>();
where i add the tasks.
I start the tasks like this:
foreach (Task t in tmp)
{
await t;
}
Now my Question:
What`s the best way to start the tasks and only run 3 of them, at the same time (until the others are waiting)?
I think i need something like a queue/waiting list?
It should also be possible to add more tasks after the queue is started.
I`am using .NET 4.5.
Thank you for any suggestion