Skip to content

Possibility of underflow #978

Description

@abh1nav10

Addresses #976.

Remote::schedule does a fetch_add with Ordering::Release on the counter. Ordering::Release only guarantees that the operations before it will not be reordered to happen after it but does not guarantee that the operations after it will not be reordered to happen before it.
That leads to the possibility of the the same scenario in which the executor might fetch_sub before the counter was incremented which would lead to underflow.

We need the semantics of the Acquire ordering here(ops after it are not reordered to happen before it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions