Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Barrier parity waiting and algorithm tweaks #69

Closed
wants to merge 5 commits into from

Conversation

ogiroux
Copy link
Contributor

@ogiroux ogiroux commented Nov 3, 2020

Adds the ability to wait on a barrier when having only retained phase parity information (from domain knowledge, it isn't recoverable from the barrier object or its tokens), like so:

barrier<> b (1);
(void)b.arrive(); // discard the nodiscard return
barrier_wait_for_parity(&b, false);

Also changed the algorithm so that some b.arrive(); can be equivalent to just a fetch_add on its constituent atomic. These are available with the __expect_extra_arrive and __extra_arrive members.

The parity waiting part isn't ABI breaking, but the algorithm tweak is ABI breaking because it halves the value of ::max(), to half of int max (which is somewhat theoretical an issue given how large this number is). I didn't add ABI handling code.

@ogiroux
Copy link
Contributor Author

ogiroux commented Nov 3, 2020

I amended the description above after reducing the ABI exposure.

@brycelelbach brycelelbach added this to the 2.0.0 milestone Feb 11, 2021
@brycelelbach
Copy link
Collaborator

Closing in favor of #111

@brycelelbach brycelelbach added enhancement New feature or request. P2: nice to have Desired for release, but not necessary. labels Mar 29, 2021
@brycelelbach brycelelbach modified the milestones: 2.0.0, 2.1.0 Mar 29, 2021
@miscco miscco deleted the olivier-barrier-tweaks branch May 23, 2023 06:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request. P2: nice to have Desired for release, but not necessary.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants