I have a counter - let's just call it : ItemsRemaining.
I will have a dynamic amount of threads, but for this example, let's say I have 10 threads.....
each thread will contain a loop, and each iteration in the loop does a unit of work, then should update the ItemsRemaining variable on GUI thread. This could be a private int, or it could even be a control value.
How can I accurately update this ItemsRemaining from multiple thread calls? While at the same time not taking too big a performance knock from locking?