Le 12/09/14 12:35, Niall Douglas a écrit :
On 11 Sep 2014 at 16:17, Steve Clark wrote:
I converted the test program to make pthread calls instead of Boost. It works perfectly, just like your Mac run. This is unsatisfactory because eventually I want the same code to run on Windows.
I've been suspicious that timed_wait() isn't actually waiting at all - just doing something like yield(). When I added a check for the current time vs. the timeout deadline into my test program, the number of spurious wakeups dropped almost to half, suggesting to me that the boost::posix_time::microsec_clock::local_time() call almost doubles the time it takes to run through the inner loop. Hmm. Maybe my timer changes on Windows for 1.56 are broken? I have to admit I relied on the unit test suite instead of manually checking I made the time calculations correctly. I believe there is a test in the unit test which checks that sleeping for a second really did take roughly a second.
Can you test 1.55 or some earlier Boost?
It seems that the problem is present in 1.55 (see https://svn.boost.org/trac/boost/ticket/9856). Niall please, could you try to reproduce it on Windows 1.55? Best, Vicente