C# enforcing order of statement execution

后端 未结 4 844
夕颜
夕颜 2021-02-13 15:15

My question is about order of execution guarantees in C# (and presumably .Net in general). I give Java examples I know something about to compare with.

For Java (from \"

4条回答
  •  無奈伤痛
    2021-02-13 15:29

    What you are looking for is Thread.MemoryBarrier

    However they may not be necessary for Microsoft's current implementation of .NET. See this SO question for more details.

提交回复
热议问题