From Jason Turner

[thread.req.timing]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpb8xhstdk/{from.md → to.md} +23 -23
tmp/tmpb8xhstdk/{from.md → to.md} RENAMED
@@ -10,60 +10,60 @@ induces a “quality of implementation” delay, expressed as duration Dᵢ.
10
  Ideally, this delay would be zero. Further, any contention for processor
11
  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 member functions whose names end in `_for` take an argument that
16
- specifies a duration. These functions produce relative timeouts.
17
- Implementations should use a steady clock to measure time for these
18
- functions.[^1] Given a duration argument Dₜ, the real-time duration of
19
- the timeout is Dₜ + Dᵢ + Dₘ.
20
 
21
- The member 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
24
  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, i.e.
31
- Cₐ + Dᵢ + Dₘ, since the timeout is already satisfied. \[*Note 1*: This
32
  specification may result in the total duration of the wait decreasing
33
- when measured against a steady clock. — *end note*]
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 2*: When the clock is adjusted backwards, this specification
37
- may 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 may result in the total duration of the wait decreasing
40
  when measured against a steady clock. — *end note*]
41
 
42
- An implementation shall return from such a timeout at any point from the
43
- time specified above to the time it would return from a steady-clock
44
- relative timeout on the difference between Cₜ and the time point of the
45
- call to the `_until` function.
46
 
47
- [*Note 3*: Implementations should decrease the duration of the wait
48
  when the clock is adjusted forwards. — *end note*]
49
 
50
- [*Note 4*: 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*.
57
 
58
- Implementation-provided clocks that are used for these functions shall
59
- meet the `TrivialClock` requirements ([[time.clock.req]]).
60
 
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 5*: 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
 
 
10
  Ideally, this delay would be zero. Further, any contention for processor
11
  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
24
  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
40
  when measured against a steady clock. — *end note*]
41
 
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*.
57
 
58
+ Implementation-provided clocks that are used for these functions meet
59
+ the *Cpp17TrivialClock* requirements [[time.clock.req]].
60
 
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