I'm using Task.WaitAny and passing in the array of tasks that are running. I would like to know how I can capture all the completed tasks' indexes, if there were multiple tasks that completes at the same time.
For instance, I'm retrieving the index of the task that completes as follows:`
int i = Task.WaitAny(taskArray);
Using the index i, I'm replacing that position in the array with another launched task. The taskArray has a fixed length and I can only launch new tasks and replace tasks in the array as they complete. How can I do this if I only get one index returned on the Task.WaitAny() and it's possible that multiple tasks within the array may complete at the same time. If only one index is returned, how do I handle other tasks that completes at the same time?
`