C# Interlocked functions as a lock mechanism?
问题 While I was reading about ReaderWriterLockSlim lock mechanism , There was this guy who suggested that Interlock Functions can be used for a finer locking Also, I found here another answer from Marc : ...Writes make their change to a cloned copy, then use Interlocked.CompareExchange to swap the reference (re-applying their change if another thread mutated the reference in the interim). Well , Currently all I know about Interlocked object , is that it is used (in a multithreaded environment) to