Skip to content

Replace volatile read/write with atomic variables #14

Description

@BrianShTsoi

As mentioned by cmartin,

[We] can probably replace all the volatile stuff in the code with regular old non-volatile, non-atomic reads and writes, and instead there would be a per-thread atomic variable (per-thread because threads never actually access each other's memory test regions) that would need to be written with Ordering::Release and then immediately read again with Ordering::Acquire to force synchronization. That would need to be done between each read/write pass of the memtest.

This will make it more likely to bypass the cache and test actual memory.
This will also make the code for memory reads/writes more straightforward, and allow the use of copy_nonoverlapping for BlockMoveTest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions