asio-tr2 icon indicating copy to clipboard operation
asio-tr2 copied to clipboard

Consider wait_traits vs extending Clock requirements vs nothing

Open chriskohlhoff opened this issue 10 years ago • 3 comments

chriskohlhoff avatar Feb 25 '15 13:02 chriskohlhoff

Just a short note to point out that I looked at scheduling as being another use-case for this: that is error correcting and min/max resolution etc.

ja11sop avatar Feb 25 '15 13:02 ja11sop

Pre-Lenexa Summary

[timer.reqmts.waittraits]

The wait traits is a customisation point that may be used for several different things:

  • Allowing the use of timers based on non-real-time clocks. E.g. to use simulated times. See http://blog.think-async.com/2007/08/time-travel.html for example.
  • Determining how quickly wallclock-based timers respond to system time changes.
  • Correcting for errors, rounding, putting timers into buckets.
  • Addressing the std::chrono duration overflow issue. That is, people may wish to schedule timers at Clock::max() (meaning never reached) or Clock::min() (meaning always in the past). However these can trigger duration overflow when compared to Clock::now() unless extra care is taken.

The options are:

  • Keep the wait traits as is.
  • Change to use an optional refinement of the existing Clock requirements.
  • Remove wait traits.

I am not in favour of any change in this area.

chriskohlhoff avatar May 05 '15 11:05 chriskohlhoff

I have to agree with this summary - wait traits supports a common use case in a clean, extensible way. If you don't need it you don't have to care about it.

ja11sop avatar May 05 '15 11:05 ja11sop