<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 956: Various threading bugs #6</title>
<meta property="og:title" content="Issue 956: Various threading bugs #6">
<meta property="og:description" content="C++ library issue. Status: C++11">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue956.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<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#C++11">C++11</a> status.</em></p>
<h3 id="956"><a href="lwg-defects.html#956">956</a>. Various threading bugs #6</h3>
<p><b>Section:</b> 30.3 <a href="https://wg21.link/time.clock.req">[time.clock.req]</a> <b>Status:</b> <a href="lwg-active.html#C++11">C++11</a>
 <b>Submitter:</b> Pete Becker <b>Opened:</b> 2009-01-07 <b>Last modified:</b> 2016-01-28</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View all other</b> <a href="lwg-index.html#time.clock.req">issues</a> in [time.clock.req].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++11">C++11</a> status.</p>
<p><b>Discussion:</b></p>
<p>
30.3 <a href="https://wg21.link/time.clock.req">[time.clock.req]</a> uses the word "native" in several places,
but doesn't define it. What is a "native <code>duration</code>"?
</p>

<p><i>[
2009-05-10 Howard adds:
]</i></p>


<blockquote><p>
The standard uses "native" in several places without defining it (e.g.
5.13.3 <a href="https://wg21.link/lex.ccon">[lex.ccon]</a>).  It is meant to mean "that which is defined
by the facility", or something along those lines.  In this case it refers
to the nested <code>time_point</code> and <code>duration</code> types of the clock.
Better wording is welcome.
</p></blockquote>

<p><i>[
Batavia (2009-05):
]</i></p>

<blockquote><p>
Move to Open pending proposed wording from Pete.
</p></blockquote>

<p><i>[
2009-10-23 Pete provides wording:
]</i></p>


<p><i>[
2009-11-18 Daniel adds:
]</i></p>


<blockquote>
<p>
I see that 32.6.4.3 <a href="https://wg21.link/thread.timedmutex.requirements">[thread.timedmutex.requirements]</a>/3 says:
</p>

<blockquote><p>
<i>Precondition:</i> If the tick <code>period</code> of <code>rel_time</code> is not
exactly convertible to the native tick <code>period</code>, the <code>duration</code>
shall be rounded up to the nearest native tick <code>period</code>.
</p></blockquote>

<p>
I would prefer to see that adapted as well. Following the same style as
the proposed resolution I come up with
</p>

<blockquote><p>
<i>Precondition:</i> If the tick <code>period</code> of <code>rel_time</code> is not
exactly convertible to the <del>native</del> tick <code>period</code> <ins>of the
execution environment</ins>, the <code>duration</code> shall be rounded up to the
nearest <del>native</del> tick <code>period</code> <ins>of the execution
environment</ins>.
</p></blockquote>

</blockquote>

<p><i>[
2010-03-28 Daniel synced wording with N3092
]</i></p>


<p><i>[
Post-Rapperswil, Howard provides wording:
]</i></p>


<blockquote><p>
Moved to Tentatively Ready with revised wording from Howard Hinnant after 5 positive votes on c++std-lib.
</p></blockquote>

<p><i>[
Adopted at 2010-11 Batavia
]</i></p>




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

<p>
Change 30.3 <a href="https://wg21.link/time.clock.req">[time.clock.req]</a>:
</p>

<blockquote>
<p>
1 A clock is a bundle consisting of a <del>native</del> <code>duration</code>, a
<del>native</del> <code>time_point</code>, and a function <code>now()</code> to get the
current <code>time_point</code>. The origin of the clock's <code>time_point</code> is
referred to as the clock's <i>epoch</i>. A clock shall meet the requirements in
Table 56.
</p>

<p>
2 ...
</p>

<table border="1">
<caption>Table 56 &mdash; Clock requirements</caption>
<tr><th>Expression</th> <th>Return type</th> <th>Operational semantics</th></tr>

<tr>
<td><code>C1::rep</code></td>
<td>An arithmetic type or a class emulating an arithmetic type</td>
<td>The representation type of <del>the native</del>
<code><ins>C1::</ins>duration</code><ins>.</ins> <del>and
<code>time_point</code>.</del></td>
</tr>

<tr>
<td><code>C1::period</code></td>
<td align="center">...</td>
<td align="center">...</td>
</tr>

<tr>
<td><code>C1::duration</code></td>
<td><code>chrono::duration&lt;C1::rep, C1::period&gt;</code></td>
<td>The <del>native</del> <code>duration</code> type of the clock.</td>
</tr>

<tr>
<td><code>C1::time_point</code></td>
<td><code>chrono::time_point&lt;C1&gt;</code> or <code>chrono::time_point&lt;C2,
C1::duration&gt;</code></td>
<td>The <del>native</del> <code>time_point</code> type of the clock. <code>C1</code> and
<code>C2</code> shall refer to the same epoch.</td>
</tr>

<tr>
<td colspan="3" align="center">...</td>
</tr>

</table>
</blockquote>






</body>
</html>
