/[Apache-SVN]
ViewVC logotype

Revision 920681


Jump to revision: Previous Next
Author: dreiss
Date: Tue Mar 9 05:20:04 2010 UTC (14 years, 8 months ago)
Changed paths: 4
Log Message:
cpp: Add profiling hooks to Mutex, ReadWriteMutex() classes

Extend the Thrift C++ Concurrency library by allowing a user to register
a callback and a sample rate for lock primitive contention profiling.
The callback will be invoked approximately once every sampleRate calls
to Mutex::lock(), Mutex::timedlock(), ReadWriteLock::acquireRead(), or
ReadWriteLock::acquireWrite().

The callback receives a pointer to the mutex responsible and the time
waited on the lock in micros (whether the lock was successfuly acquire
or not).  The user can then implement a registry of his choice to
log/collect this data as needed.

This can all be easily compiled out if it harms performance.  By
default, there is no profiling callback, so the overhead is minimal
(one branch).

Changed paths

Path Details
Directoryincubator/thrift/trunk/lib/cpp/src/concurrency/Mutex.cpp modified , text changed
Directoryincubator/thrift/trunk/lib/cpp/src/concurrency/Mutex.h modified , text changed
Directoryincubator/thrift/trunk/lib/cpp/src/concurrency/Util.cpp modified , text changed
Directoryincubator/thrift/trunk/lib/cpp/src/concurrency/Util.h modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26