C# volatile variable: Memory fences VS. caching

前端 未结 3 1994
误落风尘
误落风尘 2021-02-02 03:25

So I researched the topic for quite some time now, and I think I understand the most important concepts like the release and acquire memory fences.

Howe

3条回答
  •  天命终不由人
    2021-02-02 03:36

    Yes, volatile is about fences and fences are about ordering. So when? is not in the scope and is actually an implementation detail of all the layers (compiler, JIT, CPU etc.) combined, but every implementation should have decent and practical answer to the question.

提交回复
热议问题