Skip to content

博客文章问题 #1

Description

@cnkuangshi

关于JMM的博客,https://liuzhengyang.github.io/2017/05/12/javamemorymodel/
拜读后对Acquire-Release语义插入内存屏障实现有点疑问
原文为
`基于上面的规则,可以在volatile字段、synchronized关键字的处理上增加屏障来满足内存模型的规则

volatile store前插入StoreStore屏障
所有final字段写入后但在构造器返回前插入StoreStore
volatile store后插入StoreLoad屏障
在volatile load前插入LoadLoad和LoadStore屏障
monitor enter和volatile load规则一致,monitor exit 和volatile store规则一致。`

按我的理解,是否应该是在store前该插入storestore与loadstore,为何只插入storestore,请指教。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions