If I have this
static void Main(string[] args)
{
var tasks = new List<Task>();
for (int i = 0; i < 10; i++)
{
tasks.Add(AsyncWithBlockingIO(i));
}
Task.WaitAll(tasks.ToArray());
}
private static async Task AsyncWithBlockingIO(int fileNum)
{
var result = await File.ReadAllTextAsync($"File{fileNum}").ConfigureAwait(false);
//will the below run concurrently on multiple threads?
CpuNoIOWork(result);
}
Will CpuNoIOWork()
run concurrently on multiple threads (using the thread pool) as the IO calls complete or will it only use 1 thread at a time?