You work as the application developer at Domain.com. Domain.com uses Visual Studio.NET 2005 as its application development platform.
You are developing a .NET Framework 2.0 Windows Service application that will be used on a multiprocessor system.
You are writing code for a class that contains globally accessible Integer variable named Testcounter.
The value of the Testcounter will be incremented of decremented from other classes running in separate threads.
You are required to provide atomic and non-blocking updates for the Testcounter whilst your solution provides the best performance.
What should you do?
A.
The Interlocked class should be used
B.
The Overlapped class should be used
C.
The SynchronizationContext class should be used
D.
The SyncLock statement should be used
A