Re: [Boost-bugs] [Boost C++ Libraries] #5034: boost::this_thread::sleep either returns instantaneously or spins

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5034: boost::this_thread::sleep either returns instantaneously or spins
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-01-04 16:41:26


#5034: boost::this_thread::sleep either returns instantaneously or spins
-------------------------------+--------------------------------------------
  Reporter: Jamie Allsop | Owner: anthonyw
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.45.0 | Severity: Showstopper
Resolution: | Keywords:
-------------------------------+--------------------------------------------

Comment (by Jamie Allsop <ja11sop@…>):

 When I see the 'spinning' I can grab the following back trace - which
 doesn't say much but points to the issue being in the `timed_wait()`, see
 frame 3.

 {{{
 #0 0x00007ffff7bcbf05 in __pthread_mutex_lock (mutex=0xcf8d00) at
 pthread_mutex_lock.c:61
 #1 0x00000000008bc1c5 in boost::mutex::lock (this=0xcf8d00)
     at
 /thirdparty/boost/boost_1_45/source/boost/thread/pthread/mutex.hpp:52
 #2 0x00000000009d3d76 in boost::unique_lock<boost::mutex>::lock() ()
 #3 0x00000000009f3bf9 in
 boost::condition_variable::timed_wait(boost::unique_lock<boost::mutex>&,
 boost::posix_time::ptime const&) ()
 #4 0x00000000009f2b86 in
 boost::this_thread::sleep(boost::posix_time::ptime const&) ()
 #5 0x00000000008e68a1 in
 boost::this_thread::sleep<boost::posix_time::seconds> (rel_time=...)
     at
 /thirdparty/boost/boost_1_45/source/boost/thread/pthread/thread_data.hpp:138
 }}}

 I still don't have a small enough test case to post but thought at least
 the back trace would help. To summarise then it seems that there is an
 issue with the `timed_wait()`. Either I see it return immediately or spin.

 It should also be noted that the call to `boost::this_thread::sleep()`
 occurs once only in a single thread, in my case the main thread.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5034#comment:1>
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:05 UTC