Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10967: Timed wait points inconsistently convert relative to absolute waits
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-01-25 16:44:05
#10967: Timed wait points inconsistently convert relative to absolute waits
-------------------------------+---------------------
Reporter: ned14 | Owner: ned14
Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
Version: Boost 1.57.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+---------------------
Comment (by ned14):
I think the API naming is indeed confusing. We have four situations for
timed waits:
1. Wait until the system clock says some hour and date. If the system
clock is adjusted, I want my wait adjusted. This is the same as
wait_until(system_clock).
2. Wait until the steady clock has some deadline value. Adjustments of
system clock have no effect. This is the same as wait_until(steady_clock).
3. Wait for X ticks of the steady clock to occur. Adjustments of system
clock have no effect. This is the same as wait_for(steady_clock).
4. From my reading of the C++ standard, wait_for(system_clock) is
considered to be invalid. A static assert should probably be generated
here.
I think we need four uniquely named APIs for each of these scenarios or
four clearly named template function specialisations for both POSIX and
Windows. All timed waits anywhere in Boost.Thread go through one of those
four functions. Each API needs to take a parameter, or be named
differently, to indicate whether it is interruptible or not.
All the legacy timed wait functions need to be converted into one of these
four wait APIs too. Personally speaking I think it is time to mandatory
Chrono instead of making it optional.
Obviously this is quite a bit of work. But it serves no one well if
someone presses suspend on their computer and when they wake it up all
their Boost applications have hanged :(
I was originally given a few paid hours to look into the condvar problem
on Windows. I may be able to ask for more hours to fix more widely, then I
can help you out more than just on Windows if you need me for that. In
particular I think we need some extra tests which verify all this works
correctly.
Niall
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10967#comment:7> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC