Skip to content

InterruptSignal's hsa_signal_cas_* implementations call SetEvent even if the comparison failed. #317

Open
@benvanik

Description

@benvanik

The documentation for the signal CAS methods says:

If the value of the signal is changed, all the agents waiting on signal for which value satisfies their wait condition are awakened.

Currently the implementations in InterruptSignal (e.g. InterruptSignal::CasAcqRel) call SetEvent() unconditionally resulting in spurious wakes for any waiting agent in cases where the signal does not have the expected value. It should check to see if the observed value is the same as the expected value and only SetEvent() if so as otherwise it does not actually change anything and no waiters would be expected to make progress.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions