Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P0493 R5 Atomic maximum/minimum #866

Closed
wg21bot opened this issue May 21, 2020 · 25 comments · Fixed by cplusplus/draft#6918
Closed

P0493 R5 Atomic maximum/minimum #866

wg21bot opened this issue May 21, 2020 · 25 comments · Fixed by cplusplus/draft#6918
Labels
B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 C++26 Targeted at C++26 concurrency IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. size - medium paper size estimate
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented May 21, 2020

P0493R1 Atomic maximum/minimum (Al Grant, Bronek Kozicki)

@wg21bot wg21bot added LEWG Library Evolution SG1 Concurrency labels May 21, 2020
@wg21bot wg21bot added this to the 2020-telecon milestone May 21, 2020
@ogiroux ogiroux added this to 07/06/2020 at 8:00 AM in Remote Concurrency and Parallelism (SG1) Jun 23, 2020
@ogiroux ogiroux added the needs-revision Paper needs changes before it can proceed label Jul 7, 2020
@ogiroux
Copy link
Collaborator

ogiroux commented Jul 7, 2020

Continue the discussion of early bail offline (idempotent operations being said to be non-synchronizing while allowing strengthening as well).

Want an atomic min/max operation.
Yay 9 Nay 1

We want this operation (with the semantics we determine are right) to be called fetch_min/max.
No objections.

@brycelelbach brycelelbach added B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 IS Ship vehicle: IS labels Aug 25, 2020
@jensmaurer jensmaurer removed this from the 2020-telecon milestone Dec 27, 2020
@wg21bot
Copy link
Collaborator Author

wg21bot commented May 21, 2021

P0493R2 Atomic maximum/minimum (Al Grant, Bronek Kozicki)

@wg21bot wg21bot removed the needs-revision Paper needs changes before it can proceed label May 21, 2021
@wg21bot wg21bot added this to the 2021-telecon milestone May 21, 2021
@brycelelbach brycelelbach added size - medium paper size estimate ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list labels May 26, 2021
@inbal2l
Copy link
Collaborator

inbal2l commented Sep 11, 2021

The paper was seen by LEWG ML review. summary:

  • A request for benchmarks demonstrating the facility is better then the CAS + loop
    Authors: The performance benefit is that a non-CAS implementation would instead rely on an existing CPU-level implementation which, as the paper explains, is already available on many platforms (Editor's note: this is standardization of existing practice).

  • A request for a "Tony table" of code with and without the proposed functions
    Authors: Example of CAS exists in N2396. Example of 'atomic_fetch_max':

T atomic_fetch_max(T value)
{
    unsigned long read = this->load();
    while (value > read) {
      if (this->compare_exchange_weak(read, value))
        return read;
    }
    return read;
}
  • Regarding the write barrier macro - Is it possible that code built for an architecture that doesn’t need the barrier could run on an architecture that does, or vice versa? Point is to avoid making things compile-time constants when they might more correctly be decided at run time.
    Authors: This is a very good question. One platform made its behaviour in the past subject to environment flags.
    I hope that if such a macro was provided, it wouldn't need to be used often and in cases when it would make a difference, an alternative algorithm could be found.
    Perhaps by NOT defining such a macro, we will encourage that all algorithms should be written this way and end up with better lockfree designs.

  • Strong support in the proposal: 

    • Functionality proposed on this papier, will eliminate 99% of the CAS loop usages in the code I have written, and by doing so improve its usability.
    • Many implementations already provide intrinsics for these operations, and they are both widely used and work well.

I didn't recognize objections to the proposal.
I recommend that the authors will add the examples requested, and that we'll move fixed revision directly to electronic polls.

@inbal2l inbal2l added ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll and removed ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll labels Sep 11, 2021
@brycelelbach brycelelbach added needs-revision Paper needs changes before it can proceed expedited-library-evolution-electronic-poll Papers that were reviewed on the mailing list and then advanced directly to electronic polling. C++23 Targeted at C++23 and removed ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll labels Sep 18, 2021
@brycelelbach
Copy link

brycelelbach commented Sep 18, 2021

A Library Evolution motion was made to advance this paper directly to electronic polling. The motion failed; additional Library Evolution and Concurrency (SG1) discussion is needed.

@crtrott
Copy link

crtrott commented Sep 20, 2021

Why not also for floating point atomics? I mean min/max are useful there too, and this isn't functionally really different from atomic_add/sub which we did provide in C++20.

@crtrott
Copy link

crtrott commented Sep 20, 2021

We also may need to extend atomic_ref with the corresponding thing to keep atomic and atomic_ref in sync?

@jensmaurer
Copy link
Member

jensmaurer commented Sep 20, 2021

This issue tracker is intended exclusively for paper management and organization. Any technical discussion about a paper's content should go to the appropriate committee reflector or be raised at a face-to-face meeting (if any).

@inbal2l
Copy link
Collaborator

inbal2l commented Sep 23, 2021

@crtrott - you are most welcome to send your input on the mail thread "LEWG(I) Weekly review - P0493R2: Atomic maximum/minimum"

@brycelelbach brycelelbach added ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting and removed expedited-library-evolution-electronic-poll Papers that were reviewed on the mailing list and then advanced directly to electronic polling. labels Sep 28, 2021
@brycelelbach brycelelbach added LWG Library and removed LEWG Library Evolution ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Jan 23, 2023
@JeffGarland
Copy link
Member

LWG reviewed and approved in Issaquah

https://wiki.edg.com/bin/view/Wg21issaquah2023/P0493R4-20230209

poll: adopt P0493R4 for C++26?

F A N
11 0 0

@JeffGarland JeffGarland added the lwg-future-plenary ready to go to plenary but working draft isn't open so we are waiting label Feb 19, 2023
@wg21bot
Copy link
Collaborator Author

wg21bot commented Feb 20, 2023

P0493R4 Atomic maximum/minimum (Al Grant, Al Grant, Bronek Kozicki, Tim Northover)

@JeffGarland JeffGarland added the tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. label May 23, 2023
@JeffGarland JeffGarland removed the lwg-future-plenary ready to go to plenary but working draft isn't open so we are waiting label Jun 13, 2023
@jwakely jwakely added needs-revision Paper needs changes before it can proceed and removed tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. labels Nov 9, 2023
@jwakely
Copy link
Member

jwakely commented Nov 9, 2023

This was pulled from the polls in Varna, and there are some questions regarding min/max for floating-point types that need to be resolved (either by a new revision of this paper, or by another paper).

@gonzalobg
Copy link

gonzalobg commented Nov 10, 2023

@jwakely there is a paper regarding min/max for floating-point types: P3008 (#1672) . SG1 saw it in Kona '23, SG6 will see it next, and then it will go to LEWG.

@inbal2l
Copy link
Collaborator

inbal2l commented Jan 27, 2024

Needs a revision to apply feedback from this thread: https://lists.isocpp.org/lib-ext/2024/01/26442.php

@wg21bot
Copy link
Collaborator Author

wg21bot commented Feb 16, 2024

P0493R5 Atomic maximum/minimum (Al Grant, Al Grant, Bronek Kozicki, Tim Northover)

@wg21bot wg21bot removed the needs-revision Paper needs changes before it can proceed label Feb 16, 2024
@wg21bot wg21bot modified the milestones: 2023-telecon, 2024-telecon Feb 16, 2024
@wg21bot wg21bot changed the title P0493 Atomic maximum/minimum P0493 R5 Atomic maximum/minimum Feb 16, 2024
@inbal2l
Copy link
Collaborator

inbal2l commented Mar 5, 2024

P0493R5 dropped the floating-point change (will be resolved separately by P3008), sending P0493R5 back to LWG for C++26.

@cor3ntin cor3ntin added the plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. label Mar 23, 2024
@jensmaurer jensmaurer modified the milestones: 2024-telecon, 2024-03 Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 C++26 Targeted at C++26 concurrency IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. size - medium paper size estimate
Projects
Status: Tentatively Ready
Status: Tentatively Ready
Development

Successfully merging a pull request may close this issue.