Bug#540872: clock_gettime(2): Document that real-time processes want CLOCK_MONOTONIC, not CLOCK_REALTIME
On Mon, Apr 30, 2012 at 10:50:50AM +1200, Michael Kerrisk (man-pages) wrote: > tags 540872 fixed-upstream > thanks > > Hi Josh! > > On Mon, Apr 30, 2012 at 7:15 AM, Josh Triplett wrote: > > On Sun, Apr 29, 2012 at 10:40:48PM +1200, Michael Kerrisk (man-pages) wrote: > >> On Sun, Apr 29, 2012 at 10:21 AM, Simon Paillard > >> wrote: > >> > tags + upstream > >> > thanks > >> > > >> > Hi, > >> > > >> > On Mon, Aug 10, 2009 at 11:30:34AM -0700, Josh Triplett wrote: > >> >> Package: manpages > >> >> Version: 3.22-1 > >> >> Severity: wishlist > >> >> > >> >> Developers of real-time programs (programs using real-time scheduling > >> >> and/or expecting low latency) sometimes see CLOCK_REALTIME and think > >> >> they want to use that, when they almost certainly don't. Please > >> >> consider adding some clarification that the "real-time" of > >> >> CLOCK_REALTIME refers to wall-clock time (as opposed to CPU or process > >> >> time, for instance) and that developers of real-time applications want > >> >> to use CLOCK_MONOTONIC. > >> > > >> > Michael Kerrisk improved clock_getres.2 in manpages 3.40: > >> > > >> > .B CLOCK_MONOTONIC > >> > Clock that cannot be set and represents monotonic time since > >> > some unspecified starting point. > >> > +This clock is not affected by discontinuous jumps in the system time > >> > +(e.g., if the system administrator manually changes the clock), > >> > +but is affected by the incremental adjustments performed by > >> > +.BR adjtime (2) > >> > +and NTP. > >> > > >> > Maybe one can add (please proofread my english): > >> > "This clock allow to precisely measuring time elapsed, for use in > >> > real-time programs." > >> > > >> > http://pubs.opengroup.org/onlinepubs/009604599/functions/clock_getres.html > >> > >> Simon, would that text not better apply to CLOCK_MONOTONIC_RAW? > > > > Probably, yes. > > > > Ideally, I'd also like to see something like this added to the > > description of CLOCK_REALTIME, to help avert a common trap people fall > > into: > > > > 'The "realtime" in the name CLOCK_REALTIME refers to wall-clock time, > > not to suitability for realtime (latency-sensitive) applications. Such > > applications generally want to use CLOCK_MONOTONIC or > > CLOCK_MONOTONIC_RAW.' > > How about doing this in a different way. Instead of pointing the > reader at CLOCK_MONOTONIC*, let's be more explicit about what > CLOCK_REALTIME is, so that it's evident to the designer of a realtime > application that they don't want this clock. > > [[ > .TP > .B CLOCK_REALTIME > System-wide clock that measures real (i.e., wall-clock) time. > Setting this clock requires appropriate privileges. > This clock is affected by discontinuous jumps in the system time > (e.g., if the system administrator manually changes the clock), > and by the incremental adjustments performed by > .BR adjtime (2) > and NTP. > ]] Works for me. - Josh Triplett -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#540872: clock_gettime(2): Document that real-time processes want CLOCK_MONOTONIC, not CLOCK_REALTIME
tags 540872 fixed-upstream thanks Hi Josh! On Mon, Apr 30, 2012 at 7:15 AM, Josh Triplett wrote: > On Sun, Apr 29, 2012 at 10:40:48PM +1200, Michael Kerrisk (man-pages) wrote: >> On Sun, Apr 29, 2012 at 10:21 AM, Simon Paillard >> wrote: >> > tags + upstream >> > thanks >> > >> > Hi, >> > >> > On Mon, Aug 10, 2009 at 11:30:34AM -0700, Josh Triplett wrote: >> >> Package: manpages >> >> Version: 3.22-1 >> >> Severity: wishlist >> >> >> >> Developers of real-time programs (programs using real-time scheduling >> >> and/or expecting low latency) sometimes see CLOCK_REALTIME and think >> >> they want to use that, when they almost certainly don't. Please >> >> consider adding some clarification that the "real-time" of >> >> CLOCK_REALTIME refers to wall-clock time (as opposed to CPU or process >> >> time, for instance) and that developers of real-time applications want >> >> to use CLOCK_MONOTONIC. >> > >> > Michael Kerrisk improved clock_getres.2 in manpages 3.40: >> > >> > .B CLOCK_MONOTONIC >> > Clock that cannot be set and represents monotonic time since >> > some unspecified starting point. >> > +This clock is not affected by discontinuous jumps in the system time >> > +(e.g., if the system administrator manually changes the clock), >> > +but is affected by the incremental adjustments performed by >> > +.BR adjtime (2) >> > +and NTP. >> > >> > Maybe one can add (please proofread my english): >> > "This clock allow to precisely measuring time elapsed, for use in >> > real-time programs." >> > >> > http://pubs.opengroup.org/onlinepubs/009604599/functions/clock_getres.html >> >> Simon, would that text not better apply to CLOCK_MONOTONIC_RAW? > > Probably, yes. > > Ideally, I'd also like to see something like this added to the > description of CLOCK_REALTIME, to help avert a common trap people fall > into: > > 'The "realtime" in the name CLOCK_REALTIME refers to wall-clock time, > not to suitability for realtime (latency-sensitive) applications. Such > applications generally want to use CLOCK_MONOTONIC or > CLOCK_MONOTONIC_RAW.' How about doing this in a different way. Instead of pointing the reader at CLOCK_MONOTONIC*, let's be more explicit about what CLOCK_REALTIME is, so that it's evident to the designer of a realtime application that they don't want this clock. [[ .TP .B CLOCK_REALTIME System-wide clock that measures real (i.e., wall-clock) time. Setting this clock requires appropriate privileges. This clock is affected by discontinuous jumps in the system time (e.g., if the system administrator manually changes the clock), and by the incremental adjustments performed by .BR adjtime (2) and NTP. ]] Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/ -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#540872: clock_gettime(2): Document that real-time processes want CLOCK_MONOTONIC, not CLOCK_REALTIME
On Sun, Apr 29, 2012 at 10:40:48PM +1200, Michael Kerrisk (man-pages) wrote: > On Sun, Apr 29, 2012 at 10:21 AM, Simon Paillard wrote: > > tags + upstream > > thanks > > > > Hi, > > > > On Mon, Aug 10, 2009 at 11:30:34AM -0700, Josh Triplett wrote: > >> Package: manpages > >> Version: 3.22-1 > >> Severity: wishlist > >> > >> Developers of real-time programs (programs using real-time scheduling > >> and/or expecting low latency) sometimes see CLOCK_REALTIME and think > >> they want to use that, when they almost certainly don't. Please > >> consider adding some clarification that the "real-time" of > >> CLOCK_REALTIME refers to wall-clock time (as opposed to CPU or process > >> time, for instance) and that developers of real-time applications want > >> to use CLOCK_MONOTONIC. > > > > Michael Kerrisk improved clock_getres.2 in manpages 3.40: > > > > .B CLOCK_MONOTONIC > > Clock that cannot be set and represents monotonic time since > > some unspecified starting point. > > +This clock is not affected by discontinuous jumps in the system time > > +(e.g., if the system administrator manually changes the clock), > > +but is affected by the incremental adjustments performed by > > +.BR adjtime (2) > > +and NTP. > > > > Maybe one can add (please proofread my english): > > "This clock allow to precisely measuring time elapsed, for use in real-time > > programs." > > > > http://pubs.opengroup.org/onlinepubs/009604599/functions/clock_getres.html > > Simon, would that text not better apply to CLOCK_MONOTONIC_RAW? Probably, yes. Ideally, I'd also like to see something like this added to the description of CLOCK_REALTIME, to help avert a common trap people fall into: 'The "realtime" in the name CLOCK_REALTIME refers to wall-clock time, not to suitability for realtime (latency-sensitive) applications. Such applications generally want to use CLOCK_MONOTONIC or CLOCK_MONOTONIC_RAW.' - Josh Triplett -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#540872: clock_gettime(2): Document that real-time processes want CLOCK_MONOTONIC, not CLOCK_REALTIME
On Sun, Apr 29, 2012 at 10:21 AM, Simon Paillard wrote: > tags + upstream > thanks > > Hi, > > On Mon, Aug 10, 2009 at 11:30:34AM -0700, Josh Triplett wrote: >> Package: manpages >> Version: 3.22-1 >> Severity: wishlist >> >> Developers of real-time programs (programs using real-time scheduling >> and/or expecting low latency) sometimes see CLOCK_REALTIME and think >> they want to use that, when they almost certainly don't. Please >> consider adding some clarification that the "real-time" of >> CLOCK_REALTIME refers to wall-clock time (as opposed to CPU or process >> time, for instance) and that developers of real-time applications want >> to use CLOCK_MONOTONIC. > > Michael Kerrisk improved clock_getres.2 in manpages 3.40: > > .B CLOCK_MONOTONIC > Clock that cannot be set and represents monotonic time since > some unspecified starting point. > +This clock is not affected by discontinuous jumps in the system time > +(e.g., if the system administrator manually changes the clock), > +but is affected by the incremental adjustments performed by > +.BR adjtime (2) > +and NTP. > > Maybe one can add (please proofread my english): > "This clock allow to precisely measuring time elapsed, for use in real-time > programs." > > http://pubs.opengroup.org/onlinepubs/009604599/functions/clock_getres.html Simon, would that text not better apply to CLOCK_MONOTONIC_RAW? -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/ -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#540872: clock_gettime(2): Document that real-time processes want CLOCK_MONOTONIC, not CLOCK_REALTIME
tags + upstream thanks Hi, On Mon, Aug 10, 2009 at 11:30:34AM -0700, Josh Triplett wrote: > Package: manpages > Version: 3.22-1 > Severity: wishlist > > Developers of real-time programs (programs using real-time scheduling > and/or expecting low latency) sometimes see CLOCK_REALTIME and think > they want to use that, when they almost certainly don't. Please > consider adding some clarification that the "real-time" of > CLOCK_REALTIME refers to wall-clock time (as opposed to CPU or process > time, for instance) and that developers of real-time applications want > to use CLOCK_MONOTONIC. Michael Kerrisk improved clock_getres.2 in manpages 3.40: .B CLOCK_MONOTONIC Clock that cannot be set and represents monotonic time since some unspecified starting point. +This clock is not affected by discontinuous jumps in the system time +(e.g., if the system administrator manually changes the clock), +but is affected by the incremental adjustments performed by +.BR adjtime (2) +and NTP. Maybe one can add (please proofread my english): "This clock allow to precisely measuring time elapsed, for use in real-time programs." http://pubs.opengroup.org/onlinepubs/009604599/functions/clock_getres.html -- Simon Paillard -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#540872: clock_gettime(2): Document that real-time processes want CLOCK_MONOTONIC, not CLOCK_REALTIME
Package: manpages Version: 3.22-1 Severity: wishlist Developers of real-time programs (programs using real-time scheduling and/or expecting low latency) sometimes see CLOCK_REALTIME and think they want to use that, when they almost certainly don't. Please consider adding some clarification that the "real-time" of CLOCK_REALTIME refers to wall-clock time (as opposed to CPU or process time, for instance) and that developers of real-time applications want to use CLOCK_MONOTONIC. Thanks, Josh Triplett -- System Information: Debian Release: squeeze/sid APT prefers testing APT policy: (500, 'testing') Architecture: i386 (i686) Kernel: Linux 2.6.31-rc5 (SMP w/2 CPU cores; PREEMPT) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash manpages depends on no packages. manpages recommends no packages. Versions of packages manpages suggests: ii man-db [man-browser] 2.5.5-3on-line manual pager -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org