Re: [Boost-bugs] [Boost C++ Libraries] #9856: [windows] condition_variable::wait_for returns wrong cv_status on timeout.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9856: [windows] condition_variable::wait_for returns wrong cv_status on timeout.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-01-29 17:57:38


#9856: [windows] condition_variable::wait_for returns wrong cv_status on timeout.
-------------------------+-------------------------------------------------
  Reporter: pi88el@… | Owner: ned14
      Type: Bugs | Status: new
 Milestone: | Component: thread
   Version: Boost | Severity: Problem
  1.57.0 | Keywords: condition_variable wait_for
Resolution: | cv_status
-------------------------+-------------------------------------------------

Comment (by ned14):

 Did some testing of the performance of passing a timeout to
 WaitForMultipleObjects versus using SetWaitableTimerEx:

 Where underlying object is not signalled, 1ms timeout:

 WaitForMultipleObjects alone: 1293.457580 microsecs

 CreateWaitableTimer + SetWaitableTimer + WaitForMultipleObjects +
 CloseHandle: 1000.870380 microsecs


 Where underlying object is signalled:

 WaitForMultipleObjects alone: 0.246493 microsecs

 SetWaitableTimer + WaitForMultipleObjects: 1.062579 microsecs

 CreateWaitableTimer + SetWaitableTimer + WaitForMultipleObjects +
 CloseHandle: 2.055087 microsecs


 Moving the creation of the waitable timer outside of interruptible_wait()
 will be a pain - every interruptible_wait() user will need to cache a
 copy, or else we keep a copy in thread local storage. Given that the
 number of occasions where the underlying semaphore goes signalled in
 between the check before starting the wait and the wait beginning will be
 few, I reckon the 8x slowdown for timeouts < 20ms will be worth the ease
 of implementation. So this is what I will do.

 Niall

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9856#comment:18>
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