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

Barrier parity waiting and algorithm tweaks#69

Closed
ogiroux wants to merge 5 commits into
mainfrom
olivier-barrier-tweaks
Closed

Barrier parity waiting and algorithm tweaks#69
ogiroux wants to merge 5 commits into
mainfrom
olivier-barrier-tweaks

Conversation

@ogiroux

@ogiroux ogiroux commented Nov 3, 2020

Copy link
Copy Markdown
Contributor

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

ogiroux commented Nov 3, 2020

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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