How can I see the number of threads raised in a Parallel.ForEach loop?

Viewed 587

Given a scenario like this, running on a low power machine:

var logFile = File.ReadAllLines("logpath");
var logList = new List<string>(logFile);

Parallel.ForEach(logList.Batch(8), fileLine =>
{
    // work on the 8 lines
});

Is there a simple way I can find out the maximum number of concurrent threads that were spawned in the Parallel.ForEach process?

1 Answers
Related