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

P2835 R3 Expose std::atomic_ref's object address #1545

Open
wg21bot opened this issue May 26, 2023 · 11 comments
Open

P2835 R3 Expose std::atomic_ref's object address #1545

wg21bot opened this issue May 26, 2023 · 11 comments
Labels
B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e C++26 Targeted at C++26 IS Ship vehicle: IS 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 size - small paper size estimate
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented May 26, 2023

P2835R0 Expose std::atomic_ref's object address (Gonzalo Brito Gadeschi)

@wg21bot wg21bot added the SG1 Concurrency label May 26, 2023
@wg21bot wg21bot added this to the 2023-telecon milestone May 26, 2023
@ogiroux
Copy link
Collaborator

ogiroux commented Jun 15, 2023

Poll from SG1 in Varna:

Forward D2835R1 to LEWG for C++26
SF F N A SA
2 5 2 0 0
Unanimous consent

@wg21bot
Copy link
Collaborator Author

wg21bot commented Jul 21, 2023

P2835R1 Expose std::atomic_ref's object address (Gonzalo Brito Gadeschi)

@wg21bot wg21bot changed the title P2835 R0 Expose std::atomic_ref's object address P2835 R1 Expose std::atomic_ref's object address Jul 21, 2023
@gonzalobg
Copy link

@ogiroux @inbal2l According to isocpp.org/papers, R1 is currently addressed to LEWG, but this issue appears to only have the SG1 tag. Would it be possible for LEWG to see it this week?

@jensmaurer
Copy link
Member

SG1 already voted to forward to LEWG, so it appears to be a clerical error that the labels haven't been adjusted accordingly. Fixing that now, @ogiroux, feel free to undo if I messed things up.

@jensmaurer jensmaurer added LEWG Library Evolution and removed SG1 Concurrency labels Nov 6, 2023
@inbal2l inbal2l added B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e size - small paper size estimate IS Ship vehicle: IS C++26 Targeted at C++26 ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review and removed ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting labels Jan 5, 2024
@wg21bot
Copy link
Collaborator Author

wg21bot commented Jan 17, 2024

P2835R2 Expose std::atomic_ref's object address (Gonzalo Brito Gadeschi)

@wg21bot wg21bot modified the milestones: 2023-telecon, 2024-telecon Jan 17, 2024
@wg21bot wg21bot changed the title P2835 R1 Expose std::atomic_ref's object address P2835 R2 Expose std::atomic_ref's object address Jan 17, 2024
@ednolan
Copy link

ednolan commented Jan 22, 2024

A motion to send this to electronic polling was started on the LEWG mailing list on Jan 22, 2024.
https://lists.isocpp.org/lib-ext/2024/01/26394.php

Summary:

  • Reviewers discussed the naming of the new member function.
    • The status quo as of P2835R2 was data().
    • The author proposed address() as an alternative.
    • A reviewer noted that elsewhere in the standard library, data() refers to a contiguous range, and is paired with size(), making it less suitable as a name in this context.
    • A reviewer proposed get() by analogy with reference_wrapper. Another reviewer pointed out that, whereas users of reference_wrapper are free to access the underlying object through the wrapper or by using get(), users of atomic_ref are not allowed to access the underlying object while atomic_ref instances exist referencing it (atomics.ref.generic.general).
  • Reviewers discussed the return type of the new member function.
    • A reviewer expressed support for the P2835 status quo of T const* since it describes the thing returned, and explored the idea of adding a non-const overload returning T*.
    • A reviewer expressed opposition to T const* on the basis that accessing the underlying value is always UB, so the returned pointer is only useful as an opaque value, and therefore shouldn't be dereferenceable. The reviewer expressed support for returning void const* or uintptr_t and proposed ideas for eliminating the 1-to-1 mapping from the address of the underlying value and the value returned by the member function.
    • A reviewer raised the point that uintptr_t is optional, so the method would become unavailable on implementations without uintptr_t if it was used as the return type.
    • A reviewer pointed out that [basic.compound] p3 requires specifying which thing a returned pointer would point to.
  • Reviewers discussed the overall motivation of the proposal.
    • A reviewer objected to passing atomic_refs as parameters, claiming that the correct way to use atomic_ref is to wrap the uses, rather than the object, so the functions in the paper's example should have accepted a plain pointer type as a parameter and created atomic_ref objects at the point of use in the function, thereby making it possible to pass the plain pointer type to whatever mechanism would otherwise have required the new member function proposed by P2835.
    • Another reviewer responded that passing atomic_ref as a parameter is a legitimate, intended use case for the type, which does not mean that the user is wrapping the object instead of the uses, and provided example code for nested mdspan accessors which requires passing an atomic_ref parameter.

Due to the lack of consensus for the status quo as of P2835R2 and the desire for changes, more discussion is required and an updated paper will be scheduled for a LEWG meeting.

During the discussion, the author published a draft of an updated revision, D2835R3. The changes made are described in emails from January 22, January 25, and January 26.

@ednolan ednolan removed the ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list label Feb 2, 2024
@wg21bot
Copy link
Collaborator Author

wg21bot commented Feb 16, 2024

P2835R3 Expose std::atomic_ref's object address (Gonzalo Brito Gadeschi)

@wg21bot wg21bot changed the title P2835 R2 Expose std::atomic_ref's object address P2835 R3 Expose std::atomic_ref's object address Feb 16, 2024
@inbal2l inbal2l added the ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting label Feb 17, 2024
@inbal2l inbal2l added the ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll label Mar 29, 2024
@inbal2l
Copy link
Collaborator

inbal2l commented Apr 1, 2024

2024-03-22 Library Evolution Tokyo Meeting

P2835R3: Expose std::atomic_ref's object address

2024-03-22 Library Evolution Tokyo Meening Minutes

Champion: Gonzalo Brito Gadeschi
Chair: Robert Leahy / Inbal Levi
Minute Taker: Guy Davidson

Summary

POLL:_ Forward “P2835R3: Expose std::atomic_ref 's object address” to LWG for C++26 (to be confirmed by an electronic poll).

SF F N A SA
5 8 3 0 0

Attendance: 21 + 8
Author's Position: SF
Outcome: Consensus in favor

Next Steps

Forward “P2835R3: Expose std::atomic_ref 's object address” to LWG for C++26 (to be confirmed by an electronic poll).

@inbal2l inbal2l removed the ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting label Apr 1, 2024
@inbal2l
Copy link
Collaborator

inbal2l commented Apr 1, 2024

P2835R3 was added to 2024 April LEWG electronic poll paper (P3213R0)

@gonzalobg
Copy link

gonzalobg commented Apr 16, 2024

@inbal2l Giuseppe discovered an issue with the paper post Tokyo that impacts its design. I'd like to release a new R4 that fixes it, and then send it back to LEWG. What's the process for this? Can it be removed from the electronic poll at the author's request (to make best use of everyone's time)?

@inbal2l
Copy link
Collaborator

inbal2l commented Apr 16, 2024

As the EP paper hasn't been published yet, we'll pull this from the April EP, and re-add R4 after we see it in LEWG.
(next time please also send an explicit email for time-sensitive things, as the EP paper was about to get published, and I would have missed the notification on GitHub unless my co-chairs brought it to my attention)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e C++26 Targeted at C++26 IS Ship vehicle: IS 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 size - small paper size estimate
Projects
Development

No branches or pull requests

6 participants