From Jason Turner

[thread.req.timing]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpya14ixct/{from.md → to.md} +10 -9
tmp/tmpya14ixct/{from.md → to.md} RENAMED
@@ -12,12 +12,13 @@ and memory resources induces a “quality of management” delay, expressed
12
  as duration Dₘ. The delay durations may vary from timeout to timeout,
13
  but in all cases shorter is better.
14
 
15
  The functions whose names end in `_for` take an argument that specifies
16
  a duration. These functions produce relative timeouts. Implementations
17
- should use a steady clock to measure time for these functions.[^1] Given
18
- a duration argument Dₜ, the real-time duration of the timeout is
 
19
  Dₜ + Dᵢ + Dₘ.
20
 
21
  The functions whose names end in `_until` take an argument that
22
  specifies a time point. These functions produce absolute timeouts.
23
  Implementations should use the clock specified in the time point to
@@ -25,15 +26,15 @@ measure time for these functions. Given a clock time point argument Cₜ,
25
  the clock time point of the return from timeout should be Cₜ + Dᵢ + Dₘ
26
  when the clock is not adjusted during the timeout. If the clock is
27
  adjusted to the time Cₐ during the timeout, the behavior should be as
28
  follows:
29
 
30
- - if Cₐ > Cₜ, the waiting function should wake as soon as possible,
31
  i.e., Cₐ + Dᵢ + Dₘ, since the timeout is already satisfied. This
32
  specification may result in the total duration of the wait decreasing
33
  when measured against a steady clock.
34
- - if Cₐ ≤ Cₜ, the waiting function should not time out until
35
  `Clock::now()` returns a time Cₙ ≥ Cₜ, i.e., waking at Cₜ + Dᵢ + Dₘ.
36
  \[*Note 1*: When the clock is adjusted backwards, this specification
37
  can result in the total duration of the wait increasing when measured
38
  against a steady clock. When the clock is adjusted forwards, this
39
  specification can result in the total duration of the wait decreasing
@@ -42,15 +43,15 @@ follows:
42
  An implementation returns from such a timeout at any point from the time
43
  specified above to the time it would return from a steady-clock relative
44
  timeout on the difference between Cₜ and the time point of the call to
45
  the `_until` function.
46
 
47
- [*Note 2*: Implementations should decrease the duration of the wait
48
- when the clock is adjusted forwards. — *end note*]
49
 
50
- [*Note 3*: If the clock is not synchronized with a steady clock, e.g.,
51
- a CPU time clock, these timeouts might not provide useful
52
  functionality. — *end note*]
53
 
54
  The resolution of timing provided by an implementation depends on both
55
  operating system and hardware. The finest resolution provided by an
56
  implementation is called the *native resolution*.
@@ -61,9 +62,9 @@ the *Cpp17TrivialClock* requirements [[time.clock.req]].
61
  A function that takes an argument which specifies a timeout will throw
62
  if, during its execution, a clock, time point, or time duration throws
63
  an exception. Such exceptions are referred to as *timeout-related
64
  exceptions*.
65
 
66
- [*Note 4*: Instantiations of clock, time point and duration types
67
  supplied by the implementation as specified in  [[time.clock]] do not
68
  throw exceptions. — *end note*]
69
 
 
12
  as duration Dₘ. The delay durations may vary from timeout to timeout,
13
  but in all cases shorter is better.
14
 
15
  The functions whose names end in `_for` take an argument that specifies
16
  a duration. These functions produce relative timeouts. Implementations
17
+ should use a steady clock to measure time for these functions.[^1]
18
+
19
+ Given a duration argument Dₜ, the real-time duration of the timeout is
20
  Dₜ + Dᵢ + Dₘ.
21
 
22
  The functions whose names end in `_until` take an argument that
23
  specifies a time point. These functions produce absolute timeouts.
24
  Implementations should use the clock specified in the time point to
 
26
  the clock time point of the return from timeout should be Cₜ + Dᵢ + Dₘ
27
  when the clock is not adjusted during the timeout. If the clock is
28
  adjusted to the time Cₐ during the timeout, the behavior should be as
29
  follows:
30
 
31
+ - If Cₐ > Cₜ, the waiting function should wake as soon as possible,
32
  i.e., Cₐ + Dᵢ + Dₘ, since the timeout is already satisfied. This
33
  specification may result in the total duration of the wait decreasing
34
  when measured against a steady clock.
35
+ - If Cₐ ≤ Cₜ, the waiting function should not time out until
36
  `Clock::now()` returns a time Cₙ ≥ Cₜ, i.e., waking at Cₜ + Dᵢ + Dₘ.
37
  \[*Note 1*: When the clock is adjusted backwards, this specification
38
  can result in the total duration of the wait increasing when measured
39
  against a steady clock. When the clock is adjusted forwards, this
40
  specification can result in the total duration of the wait decreasing
 
43
  An implementation returns from such a timeout at any point from the time
44
  specified above to the time it would return from a steady-clock relative
45
  timeout on the difference between Cₜ and the time point of the call to
46
  the `_until` function.
47
 
48
+ *Recommended practice:* Implementations should decrease the duration of
49
+ the wait when the clock is adjusted forwards.
50
 
51
+ [*Note 2*: If the clock is not synchronized with a steady clock, e.g.,
52
+ a CPU time clock, these timeouts can fail to provide useful
53
  functionality. — *end note*]
54
 
55
  The resolution of timing provided by an implementation depends on both
56
  operating system and hardware. The finest resolution provided by an
57
  implementation is called the *native resolution*.
 
62
  A function that takes an argument which specifies a timeout will throw
63
  if, during its execution, a clock, time point, or time duration throws
64
  an exception. Such exceptions are referred to as *timeout-related
65
  exceptions*.
66
 
67
+ [*Note 3*: Instantiations of clock, time point and duration types
68
  supplied by the implementation as specified in  [[time.clock]] do not
69
  throw exceptions. — *end note*]
70