This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.

956. Various threading bugs #6

Section: 30.3 [time.clock.req] Status: C++11 Submitter: Pete Becker Opened: 2009-01-07 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [time.clock.req].

View all issues with C++11 status.

Discussion:

30.3 [time.clock.req] uses the word "native" in several places, but doesn't define it. What is a "native duration"?

[ 2009-05-10 Howard adds: ]

The standard uses "native" in several places without defining it (e.g. 5.13.3 [lex.ccon]). 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 time_point and duration types of the clock. Better wording is welcome.

[ Batavia (2009-05): ]

Move to Open pending proposed wording from Pete.

[ 2009-10-23 Pete provides wording: ]

[ 2009-11-18 Daniel adds: ]

I see that 32.6.4.3 [thread.timedmutex.requirements]/3 says:

Precondition: If the tick period of rel_time is not exactly convertible to the native tick period, the duration shall be rounded up to the nearest native tick period.

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

Precondition: If the tick period of rel_time is not exactly convertible to the native tick period of the execution environment, the duration shall be rounded up to the nearest native tick period of the execution environment.

[ 2010-03-28 Daniel synced wording with N3092 ]

[ Post-Rapperswil, Howard provides wording: ]

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

[ Adopted at 2010-11 Batavia ]

Proposed resolution:

Change 30.3 [time.clock.req]:

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

2 ...

Table 56 — Clock requirements
Expression Return type Operational semantics
C1::rep An arithmetic type or a class emulating an arithmetic type The representation type of the native C1::duration. and time_point.
C1::period ... ...
C1::duration chrono::duration<C1::rep, C1::period> The native duration type of the clock.
C1::time_point chrono::time_point<C1> or chrono::time_point<C2, C1::duration> The native time_point type of the clock. C1 and C2 shall refer to the same epoch.
...