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).
Addresses #976.
Remote::scheduledoes afetch_addwithOrdering::Releaseon the counter.Ordering::Releaseonly 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_subbefore the counter was incremented which would lead to underflow.We need the semantics of the
Acquireordering here(ops after it are not reordered to happen before it).