Re: [Boost-bugs] [Boost C++ Libraries] #7665: this_thread::sleep_for no longer uses steady_clock in thread

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7665: this_thread::sleep_for no longer uses steady_clock in thread
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-07 13:21:10


#7665: this_thread::sleep_for no longer uses steady_clock in thread
---------------------------+------------------------
  Reporter: ewdevel@… | Owner: viboes
      Type: Bugs | Status: reopened
 Milestone: Boost 1.53.0 | Component: thread
   Version: Boost 1.52.0 | Severity: Regression
Resolution: | Keywords:
---------------------------+------------------------

Comment (by Volker Prüß <Volker_Pruess@…>):

 I'm not quite sure about the solution you proposed but I see the problem :

 * 'boost::this_thread::sleep_for' has to remain an interruption point
 * there are no standard library or pthread functions allowing interuptible
 operation based upon a stable clock, especially for a portable library.

 I checked against the c++ library provided alongside with the gcc 4.6.3
 and at least their implementation of sleep_for is not affected by changes
 in the system clock. It seems that the gcc implementation is based upon
 nanosleep (http://stackoverflow.com/questions/12523122/what-is-glibcxx-
 use-nanosleep-all-about), IMHO therefore not interruptible.

 I'm not quite sure whether an implementation of sleep_for (and sleep) that
 is affected by changes made to the system clock would be acceptable
 anyway. And moving sleep_for out of the namespace 'this_thread' would
 break existing code.

 Seems to be a question for the standard library experts ...

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7665#comment:13>
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:15 UTC