Skip to content

Better implementation of IAtomicArray #1

Open
@halgari

Description

@halgari

There really isn't any reason to have IAtomicArray. On the JVM we have a bad situation since we don't have memory barriers, and so there is no way to force the CPU to flush all data written to the state array. The situation on the CLR is much better:

For this CLR port I recommend switching away from an atomic array to a Object[]. All you need to do then is a call to Thread.MemoryBarrier() on the exit of every loop (see line 923 in ioc_macros.clj). This should actually be pretty fast since the array can be held purely in the cache until it's flushed each time the state machine is paused.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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