Skip to content

Commit

Permalink
Automatic update from GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 4, 2023
1 parent 838f9e1 commit c6c495a
Show file tree
Hide file tree
Showing 22 changed files with 413 additions and 197 deletions.
102 changes: 48 additions & 54 deletions issue4004.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html>
<head>
<meta charset="utf-8">
<title>Issue 4004: It is underspecified in which header std::formatter specializations for container adaptors are provided</title>
<title>Issue 4004: The load and store operation in &sect;[atomics.order] p1 is ambiguous</title>
<style type="text/css">
p {text-align:justify}
li {text-align:justify}
Expand Down Expand Up @@ -45,72 +45,66 @@
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#New">New</a> status.</em></p>
<h3><a name="4004" href="lwg-active.html#4004">4004</a>. It is underspecified in which header <tt>std::formatter</tt> specializations for container adaptors are provided</h3>
<p><b>Section:</b> 24.6.13 <a href="https://wg21.link/container.adaptors.format">[container.adaptors.format]</a> <b>Status:</b> <a href="lwg-active.html#New">New</a>
<b>Submitter:</b> Jiang An <b>Opened:</b> 2023-10-29 <b>Last modified:</b> 2023-10-29</p>
<h3><a name="4004" href="lwg-active.html#4004">4004</a>. The load and store operation in &sect;[atomics.order] p1 is ambiguous</h3>
<p><b>Section:</b> 33.5.4 <a href="https://wg21.link/atomics.order">[atomics.order]</a> <b>Status:</b> <a href="lwg-active.html#New">New</a>
<b>Submitter:</b> jim x <b>Opened:</b> 2023-10-30 <b>Last modified:</b> 2023-11-04</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View all other</b> <a href="lwg-index.html#container.adaptors.format">issues</a> in [container.adaptors.format].</p>
<p><b>View other</b> <a href="lwg-index-open.html#atomics.order">active issues</a> in [atomics.order].</p>
<p><b>View all other</b> <a href="lwg-index.html#atomics.order">issues</a> in [atomics.order].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#New">New</a> status.</p>
<p><b>Discussion:</b></p>
<p>
<a href="https://wg21.link/P2286R8">P2286R8</a> added <tt>std::formatter</tt> specializations for container adaptors, but didn't show them
in synopses of headers. Presumably these specializations should be provided in <tt>&lt;stack&gt;</tt> and <tt>&lt;queue&gt;</tt>.
33.5.4 <a href="https://wg21.link/atomics.order">[atomics.order]</a> p1 says:
</p>


<p id="res-4004"><b>Proposed resolution:</b></p>
<blockquote style="border-left: 3px solid #ccc;padding-left: 15px;">
<ol style="list-style-type: none">
<li><p>(1.2) &mdash; <tt>memory_order::release</tt>, <tt>memory_order::acq_rel</tt>, and <tt>memory_order::seq_cst</tt>: a store operation
performs a release operation on the affected memory location.</p></li>
<li><p>(1.3) &mdash; <tt>memory_order::consume</tt>: a load operation performs a consume operation on the affected memory location.
[&hellip;]</p></li>
<li><p>(1.4) &mdash; <tt>memory_order::acquire</tt>, <tt>memory_order::acq_rel</tt>, and <tt>memory_order::seq_cst</tt>: a
load operation performs an acquire operation on the affected memory location.</p></li>
</ol>
</blockquote>
<p>
This wording is relative to <a href="https://wg21.link/N4964">N4964</a>.
What do the store and load operations intend to mean in this context? If there is no extra specification,
it is easy to consider them as the operations performed by the non-static member functions "store" and "load"
defined in the <tt>atomic</tt> class (template).
<p/>
33.5.4 <a href="https://wg21.link/atomics.order">[atomics.order]</a> p2 says
</p>
<blockquote style="border-left: 3px solid #ccc;padding-left: 15px;">
<p>
An atomic operation <i>A</i> that performs a release operation on an atomic object <i>M</i> synchronizes with
an atomic operation <i>B</i> that performs an acquire operation on <i>M</i> and takes its value from any side
effect in the release sequence headed by <i>A</i>.
</p>
</blockquote>
<p>
According to the above interpretation, <i>A</i> is an operation performed by the non-static member function
<tt>store</tt>, however, I think the following example can establish the synchronization relationship
</p>

<ol>

<li><p>Modify 24.6.2 <a href="https://wg21.link/queue.syn">[queue.syn]</a>, header <tt>&lt;queue&gt;</tt> synopsis, as indicated:</p>

<blockquote><pre>
[&hellip;]
namespace std {
// <i>24.6.6 <a href="https://wg21.link/queue">[queue]</a>, class template</i> queue
template&lt;class T, class Container = deque&lt;T&gt;&gt; class queue;
[&hellip;]
template&lt;class T, class Container, class Alloc&gt;
struct uses_allocator&lt;queue&lt;T, Container&gt;, Alloc&gt;;
<ins>template&lt;class charT, class T, formattable&lt;charT&gt; Container&gt;
struct formatter&lt;queue&lt;T, Container&gt;, charT&gt;;</ins>

// <i>24.6.7 <a href="https://wg21.link/priority.queue">[priority.queue]</a>, class template</i> priority_queue
template&lt;class T, class Container = vector&lt;T&gt;,
class Compare = less&lt;typename Container::value_type&gt;&gt;
class priority_queue;
[&hellip;]
template&lt;class T, class Container, class Compare, class Alloc&gt;
struct uses_allocator&lt;priority_queue&lt;T, Container, Compare>,&gt;, Alloc&gt;;
<ins>template&lt;class charT, class T, formattable&lt;charT&gt; Container, class Compare&gt;
struct formatter&lt;priority_queue&lt;T, Container, Compare&gt;, charT&gt;;</ins>
}
</pre></blockquote>

</li>
std::atomic&lt;int&gt; x{0};
Thread 1:
int expected = 0;
x.compare_exchange_strong(expected, 1, memory_order::release, memory_order::relaxed ); //#1

<li><p>Modify 24.6.3 <a href="https://wg21.link/stack.syn">[stack.syn]</a>, header <tt>&lt;stack&gt;</tt> synopsis, as indicated:</p>

<blockquote><pre>
[&hellip;]
namespace std {
// <i>24.6.8 <a href="https://wg21.link/stack">[stack]</a>, class template</i> stack
template&lt;class T, class Container = deque&lt;T&gt;&gt; class stack;
[&hellip;]
template&lt;class T, class Container, class Alloc&gt;
struct uses_allocator&lt;stack&lt;T, Container&gt;, Alloc&gt;;
<ins>template&lt;class charT, class T, formattable&lt;charT&gt; Container&gt;
struct formatter&lt;stack&lt;T, Container&gt;, charT&gt;;</ins>
}
Thread 2:
int expected = 1;
while(x.compare_exchange_strong( expected, 2, memory_order::acquire, memory_order::relaxed )){} // #2
</pre></blockquote>
<p>
Assuming the RMW operations are successful in the two threads, I think <tt>#1</tt> intends to perform a
release operation while <tt>#2</tt> performs an acquire operation, and hence they can establish the
synchronization relationship, however, they both are RMW operations.
<p/>
It should be clearly defined which are store operations and which are load operations.
</p>

</li>

</ol>
<p id="res-4004"><b>Proposed resolution:</b></p>



Expand Down
74 changes: 70 additions & 4 deletions lwg-active.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</tr>
</table>
<h1>C++ Standard Library Active Issues List (Revision D125)</h1>
<p><p>Revised 2023-11-04 at 13:37:08 UTC</p>
<p><p>Revised 2023-11-04 at 14:43:44 UTC</p>
</p>
<p>Reference ISO/IEC IS 14882:2020(E)</p>
<p>Also see:</p>
Expand Down Expand Up @@ -182,16 +182,16 @@ <h2 id='History'>Revision History</h2>
<ul>
<li>D125: 2023-06-09 Post-Varna<ul>
<li><b>Summary:</b><ul>
<li>468 open issues, up by 38.</li>
<li>469 open issues, up by 39.</li>
<li>3020 closed issues, up by 20.</li>
<li>37 reassigned issues, up by 1.</li>
<li>3525 issues total, up by 59.</li>
<li>3526 issues total, up by 60.</li>
</ul></li>
<li><b>Details:</b><ul>
<li>Added the following Ready issue: <a href="lwg-active.html#3946">3946</a>.</li>
<li>Added the following 13 Tentatively Ready issues: <a href="lwg-active.html#3947">3947</a>, <a href="lwg-active.html#3948">3948</a>, <a href="lwg-active.html#3949">3949</a>, <a href="lwg-active.html#3951">3951</a>, <a href="lwg-active.html#3953">3953</a>, <a href="lwg-active.html#3957">3957</a>, <a href="lwg-active.html#3965">3965</a>, <a href="lwg-active.html#3970">3970</a>, <a href="lwg-active.html#3973">3973</a>, <a href="lwg-active.html#3974">3974</a>, <a href="lwg-active.html#3987">3987</a>, <a href="lwg-active.html#3990">3990</a>, <a href="lwg-active.html#4001">4001</a>.</li>
<li>Added the following 5 Tentatively NAD issues: <a href="lwg-active.html#3958">3958</a>, <a href="lwg-active.html#3980">3980</a>, <a href="lwg-active.html#3981">3981</a>, <a href="lwg-active.html#3982">3982</a>, <a href="lwg-active.html#3996">3996</a>.</li>
<li>Added the following 38 New issues: <a href="lwg-active.html#3945">3945</a>, <a href="lwg-active.html#3950">3950</a>, <a href="lwg-active.html#3952">3952</a>, <a href="lwg-active.html#3954">3954</a>, <a href="lwg-active.html#3955">3955</a>, <a href="lwg-active.html#3956">3956</a>, <a href="lwg-active.html#3959">3959</a>, <a href="lwg-active.html#3960">3960</a>, <a href="lwg-active.html#3961">3961</a>, <a href="lwg-active.html#3962">3962</a>, <a href="lwg-active.html#3963">3963</a>, <a href="lwg-active.html#3964">3964</a>, <a href="lwg-active.html#3966">3966</a>, <a href="lwg-active.html#3967">3967</a>, <a href="lwg-active.html#3968">3968</a>, <a href="lwg-active.html#3969">3969</a>, <a href="lwg-active.html#3972">3972</a>, <a href="lwg-active.html#3975">3975</a>, <a href="lwg-active.html#3976">3976</a>, <a href="lwg-active.html#3977">3977</a>, <a href="lwg-active.html#3978">3978</a>, <a href="lwg-active.html#3979">3979</a>, <a href="lwg-active.html#3983">3983</a>, <a href="lwg-active.html#3984">3984</a>, <a href="lwg-active.html#3985">3985</a>, <a href="lwg-active.html#3986">3986</a>, <a href="lwg-active.html#3989">3989</a>, <a href="lwg-active.html#3991">3991</a>, <a href="lwg-active.html#3992">3992</a>, <a href="lwg-active.html#3993">3993</a>, <a href="lwg-active.html#3994">3994</a>, <a href="lwg-active.html#3995">3995</a>, <a href="lwg-active.html#3997">3997</a>, <a href="lwg-active.html#3998">3998</a>, <a href="lwg-active.html#3999">3999</a>, <a href="lwg-active.html#4000">4000</a>, <a href="lwg-active.html#4002">4002</a>, <a href="lwg-active.html#4003">4003</a>.</li>
<li>Added the following 39 New issues: <a href="lwg-active.html#3945">3945</a>, <a href="lwg-active.html#3950">3950</a>, <a href="lwg-active.html#3952">3952</a>, <a href="lwg-active.html#3954">3954</a>, <a href="lwg-active.html#3955">3955</a>, <a href="lwg-active.html#3956">3956</a>, <a href="lwg-active.html#3959">3959</a>, <a href="lwg-active.html#3960">3960</a>, <a href="lwg-active.html#3961">3961</a>, <a href="lwg-active.html#3962">3962</a>, <a href="lwg-active.html#3963">3963</a>, <a href="lwg-active.html#3964">3964</a>, <a href="lwg-active.html#3966">3966</a>, <a href="lwg-active.html#3967">3967</a>, <a href="lwg-active.html#3968">3968</a>, <a href="lwg-active.html#3969">3969</a>, <a href="lwg-active.html#3972">3972</a>, <a href="lwg-active.html#3975">3975</a>, <a href="lwg-active.html#3976">3976</a>, <a href="lwg-active.html#3977">3977</a>, <a href="lwg-active.html#3978">3978</a>, <a href="lwg-active.html#3979">3979</a>, <a href="lwg-active.html#3983">3983</a>, <a href="lwg-active.html#3984">3984</a>, <a href="lwg-active.html#3985">3985</a>, <a href="lwg-active.html#3986">3986</a>, <a href="lwg-active.html#3989">3989</a>, <a href="lwg-active.html#3991">3991</a>, <a href="lwg-active.html#3992">3992</a>, <a href="lwg-active.html#3993">3993</a>, <a href="lwg-active.html#3994">3994</a>, <a href="lwg-active.html#3995">3995</a>, <a href="lwg-active.html#3997">3997</a>, <a href="lwg-active.html#3998">3998</a>, <a href="lwg-active.html#3999">3999</a>, <a href="lwg-active.html#4000">4000</a>, <a href="lwg-active.html#4002">4002</a>, <a href="lwg-active.html#4003">4003</a>, <a href="lwg-active.html#4004">4004</a>.</li>
<li>Added the following 2 SG9 issues: <a href="lwg-active.html#3971">3971</a>, <a href="lwg-active.html#3988">3988</a>.</li>
<li>Changed the following 6 issues to Ready (from New): <a href="lwg-active.html#2392">2392</a>, <a href="lwg-active.html#3203">3203</a>, <a href="lwg-active.html#3431">3431</a>, <a href="lwg-active.html#3749">3749</a>, <a href="lwg-active.html#3892">3892</a>, <a href="lwg-active.html#3897">3897</a>.</li>
<li>Changed the following issue to Ready (from Open): <a href="lwg-active.html#3305">3305</a>.</li>
Expand Down Expand Up @@ -57246,5 +57246,71 @@ <h3><a name="4003" href="#4003">4003</a><sup><a href="https://cplusplus.github.i



<hr>
<h3><a name="4004" href="#4004">4004</a><sup><a href="https://cplusplus.github.io/LWG/issue4004">(i)</a></sup>. The load and store operation in &sect;[atomics.order] p1 is ambiguous</h3>
<p><b>Section:</b> 33.5.4 <a href="https://wg21.link/atomics.order">[atomics.order]</a> <b>Status:</b> <a href="lwg-active.html#New">New</a>
<b>Submitter:</b> jim x <b>Opened:</b> 2023-10-30 <b>Last modified:</b> 2023-11-04</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View other</b> <a href="lwg-index-open.html#atomics.order">active issues</a> in [atomics.order].</p>
<p><b>View all other</b> <a href="lwg-index.html#atomics.order">issues</a> in [atomics.order].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#New">New</a> status.</p>
<p><b>Discussion:</b></p>
<p>
33.5.4 <a href="https://wg21.link/atomics.order">[atomics.order]</a> p1 says:
</p>
<blockquote style="border-left: 3px solid #ccc;padding-left: 15px;">
<ol style="list-style-type: none">
<li><p>(1.2) &mdash; <tt>memory_order::release</tt>, <tt>memory_order::acq_rel</tt>, and <tt>memory_order::seq_cst</tt>: a store operation
performs a release operation on the affected memory location.</p></li>
<li><p>(1.3) &mdash; <tt>memory_order::consume</tt>: a load operation performs a consume operation on the affected memory location.
[&hellip;]</p></li>
<li><p>(1.4) &mdash; <tt>memory_order::acquire</tt>, <tt>memory_order::acq_rel</tt>, and <tt>memory_order::seq_cst</tt>: a
load operation performs an acquire operation on the affected memory location.</p></li>
</ol>
</blockquote>
<p>
What do the store and load operations intend to mean in this context? If there is no extra specification,
it is easy to consider them as the operations performed by the non-static member functions "store" and "load"
defined in the <tt>atomic</tt> class (template).
<p/>
33.5.4 <a href="https://wg21.link/atomics.order">[atomics.order]</a> p2 says
</p>
<blockquote style="border-left: 3px solid #ccc;padding-left: 15px;">
<p>
An atomic operation <i>A</i> that performs a release operation on an atomic object <i>M</i> synchronizes with
an atomic operation <i>B</i> that performs an acquire operation on <i>M</i> and takes its value from any side
effect in the release sequence headed by <i>A</i>.
</p>
</blockquote>
<p>
According to the above interpretation, <i>A</i> is an operation performed by the non-static member function
<tt>store</tt>, however, I think the following example can establish the synchronization relationship
</p>
<blockquote><pre>
std::atomic&lt;int&gt; x{0};
Thread 1:
int expected = 0;
x.compare_exchange_strong(expected, 1, memory_order::release, memory_order::relaxed ); //#1

Thread 2:
int expected = 1;
while(x.compare_exchange_strong( expected, 2, memory_order::acquire, memory_order::relaxed )){} // #2
</pre></blockquote>
<p>
Assuming the RMW operations are successful in the two threads, I think <tt>#1</tt> intends to perform a
release operation while <tt>#2</tt> performs an acquire operation, and hence they can establish the
synchronization relationship, however, they both are RMW operations.
<p/>
It should be clearly defined which are store operations and which are load operations.
</p>


<p id="res-4004"><b>Proposed resolution:</b></p>





</body>
</html>
Loading

0 comments on commit c6c495a

Please sign in to comment.