[Boost-bugs] [Boost C++ Libraries] #3500: Optimization for win32 mutex implementation

Subject: [Boost-bugs] [Boost C++ Libraries] #3500: Optimization for win32 mutex implementation
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-10-01 13:50:40


#3500: Optimization for win32 mutex implementation
--------------------------+-------------------------------------------------
 Reporter: andysem | Owner: anthonyw
     Type: Patches | Status: new
Milestone: Boost 1.41.0 | Component: thread
  Version: Boost 1.40.0 | Severity: Optimization
 Keywords: thread mutex |
--------------------------+-------------------------------------------------
 While I was porting my code from raw Win32 CRITICAL_SECTION to
 boost::mutex I noticed a performance drop of around 10% in cases where
 thread contention was quite rare.

 After some experimenting it appeared that the problem was in the
 boost/thread/win32/basic_timed_mutex.hpp file. The basic_timed_mutex::lock
 method always constructed time point to pass it to the timed_lock method,
 even though it is not needed for the quick path. When I modified the
 methods the performance counters met values I had with raw
 CRITICAL_SECTION.

 Please, find the patch attached. The patch is against 1.40 release.

 PS: I'm using MSVC 7.1, I didn't test on newer compilers.

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