-
Notifications
You must be signed in to change notification settings - Fork 1
P2019 R8 Thread attributes #817
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
Comments
We want the ability to provide attributes to thread (full threads: thread, jthread) constructors, even if we can't specify their semantics fully. The name attribute. The stack size attribute. Nay: round up the other authors (like Patrice) from before, that will improve my view of stack size. |
P2019R1 Usability improvements for std::thread (Corentin Jabot) |
P2019R2 Usability improvements for std::thread (Corentin Jabot) |
Poll: Forward the thread name attribute design of P2019R2 to LEWG Unanimous consent Poll: Forward the thread stack size attribute design of P2019R2 to LEWG Consensus Poll: Open a CWG issue to have words in the standard that speak to runtime Consensus |
2023-01-24 ISO C++ Library Evolution TeleconP2019R2: Thread Attributes 2023-01-24 Library Evolution Telecon Minutes Champion: Corentin Jabot Chair: Bryce Adelstein Lelbach Minute Taker: Ben Craig Start: 2023-01-24 11:12 Eastern Does this paper have:
What are considered valid thread stack sizes and thread names? Do we specify anything about that? If I use an invalid thread stack size or name, do I get an exception? Is it undefined behavior? Can the thread stack size or name be silently ignored? Are thread stack sizes specified to be in bytes, or is it intentionally unitless? Why no thread priority in this proposal? Because they vary across platforms and we don't know how to specify them portably. Does using a capturing lambda instead of the function + arguments constructor have a performance penalty? The author indicates it should not. What is the "Recommended Practice" clause used in the wording? Is that new? What do the major implementers think about these proposed features? Should thread stack size and names be compile time parameters? Is What if I want to start a thread with a function that takes an attribute? There may be ambiguities between the function + attributes and function + arguments constructors.
Topics to Polls:
POLL: The initial release of standard library thread attributes should have thread priorities.
Attendance: 21 # of Authors: 1 Author Position: SA Outcome: Weak consensus against. POLL: The initial release of standard library thread attributes should have a query for a thread's name.
Attendance: 21 # of Authors: 1 Author Position: SA Outcome: No consensus. POLL: The initial release of standard library thread attributes should allow a thread's name to be set after thread construction.
Attendance: 21 # of Authors: 1 Author Position: SA Outcome: No consensus. POLL: Add a factory function for constructing threads with attributes instead of adding a new constructor.
Attendance: 21 # of Authors: 1 Author Position: N Outcome: No consensus. WA: I don't understand why a factory function would be necessary based on the discussion. I could be convinced, but I'm veering towards simplicity. POLL: The mechanism for constructing threads with attributes should take arguments to the thread function in addition to attributes.
Attendance: 21 # of Authors: 1 Author Position: SA Outcome: No consensus. WA: I'm concerned about the complexity this would add and I think it's unnecessary; you can just use a lambda with captures. POLL: Thread attributes should be passed as a single aggregated argument instead of being passed as variadic arguments.
Attendance: 21 # of Authors: 1 Author Position: SA Outcome: No consensus. End: 12:24 SummaryThis paper proposes adding thread attributes to We talked considered what the scope of this proposal should be. Should thread priorities be included? Should we be able to query attributes of a thread? Should we be able to set them after construction? After discussion, we had consensus to exclude thread priorities, but we had no consensus on querying and setting attributes after construction. We also discussed the API for setting attributes on thread construction. The current proposal adds a new constructor that takes a thread function and a variadic pack of attributes, but no arguments for the thread function. Some suggested that the constructor should take both attributes and function arguments. There was a concern that the new constructor could be unclear - are the arguments to a Our review and polling made it clear that Library Evolution is still undecided about many of the major design choices about this feature. There is a lot of interest in this capability, but we need more information on these design questions so that we can decide on the answers. Next StepsRevise the paper to provide more information to help neutrals/undecided form an opinion on design choices and then return to Library Evolution:
|
P2019R6 Thread attributes (Corentin Jabot) |
LWG gave author feedback in St. Louis meeting -- paper needs updates. |
P2019R7 Thread attributes (Corentin Jabot) |
SG16 reviewed P2019R7 during its 2024-09-25 meeting. The following polls were taken:
These polls were intentionally contradictory. The second poll had stronger consensus, but with increased opposition and fewer strong proponents. Further discussion in SG16 is warranted. The name hint feature collides with existing tension in the C++ standard regarding locale support in C and C++. A C++ program maintains distinct locale configuration for C and C++. Threads are a low level feature that interacts with C and C++, but the proposed interfaces are specific to C++. On Windows, thread names, when exposed in |
SG16 reviewed P2019R7 again during its 2025-01-22 meeting. The following poll was taken:
The new poll subsumes the previous polls from the 2024-09-25 SG16 meeting. There was less discussion regarding the use of the C locale and an NTMBS as polled last time. We clarified that, from the underlying platform perspective, thread names are held in an environment encoding (POSIX locale) or system encoding (UTF-16 on Windows). We discussed the approach of requiring programmers to provide names in the environment encoding (POSIX locale or Active Code Page (ACP) on Windows), but concerns were raised that, 1) there are no standard facilities to produce strings in such encodings today, and 2) using |
2025-02-13 Library Evolution Hagenberg MeetingP2019R7 Thread attributes 2025-02-13 Library Evolution Hagenberg Minutes Champion: Corentin Jabot SummaryPOLL: Approve the change as suggested by SG16 and send D2019R8 back to LWG for C++26
Attendance: 31 (IP) + 10 (R) Next StepsApprove changes asked by SG16 and send back to LWG. |
P2019R8 Thread attributes (Corentin Jabot) |
P2019R0 Usability improvements for std::thread (Corentin Jabot)
The text was updated successfully, but these errors were encountered: