Skip to content

[atomic-primops] Please clarify whether atomic operations are barriers or not #39

@jberryman

Description

@jberryman

It would be nice to know whether or not casIORef, fetchAddByteArray, etc. represent memory barriers, or not, at the compiler level. In other words, may GHC reorder stores or loads across these operations, regardless of whether the underlying primop is a barrier on a particular architecture? Or like atomicModifyIORef do they guarantee some ordering?

There's mention of how the read operations don't imply any barriers, which suggests that maybe the atomic ops do. If this isn't defined in GHC then it would be nice to clarify that there, obviously. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions