Search code examples
c#multithreadinglockingshared-memorymemory-model

c# memory model, locking, and syncronization


Does the c# memory model guarantee that a thread holding a lock is guaranteed to see all updates performed while any other thread previously held the same lock?

I have been reading the c# specification but cant seem to find the specifics on this.


Solution

  • Yes, subject to certain restrictions.For details, the section you are looking for is 3.10.