[Boost-bugs] [Boost C++ Libraries] #6108: Boost interprocess lock consumes 100% CPU on OS X

Subject: [Boost-bugs] [Boost C++ Libraries] #6108: Boost interprocess lock consumes 100% CPU on OS X
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-09 10:08:03


#6108: Boost interprocess lock consumes 100% CPU on OS X
-------------------------------------------+--------------------------------
 Reporter: tibdewal.rahulkumar@… | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.47.0 | Severity: Showstopper
 Keywords: |
-------------------------------------------+--------------------------------
 I have some code which waits for write operation on Shared Memory. If no
 one writes it continues to wait.

 {{{
     Test* Foo::Get()
     {
 boost::interprocess::scoped_lock<boost::interprocess::interprocess_mutex>
 lock ( mutex ) ; // mutex is boost::interprocess::interprocess_mutex
         if ( this->check == 0 )
             this->interprocessCondition.wait ( lock ) ; //
 interprocessCondition is boost::interprocess::interprocess_condition

 ...
     }
 }}}

 CPU consumption is 100%.

 Debugging leads to inline void sched_yield(), for windows it calls
 Sleep(1) but I cannot find any definition for Mac.

 I believe we need sched_yield() implementation and may be usleep(1000)
 within it.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6108>
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:07 UTC