You can use Interlocked.Increment
method for that:
int progress = 0;
Parallel.For(0, 10, i =>
{
Parallel.For(0, 10, j =>
{
// Do somethings...
Console.WriteLine("{0}% Done!", Interlocked.Increment(ref progress));
});
});
There will be one increment per iteration of the inner loop. Some printouts may appear out of sequence - specifically, when a thread is preempted after obtaining the new value of the progress but before the printing is complete.