summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api/signals/main.cpp
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2016-04-14 16:00:37 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2016-04-14 16:00:37 +0000
commit377aa40d84fefff341525efb2b60a805dbf96c1e (patch)
tree92881a2b4378d0e5d48c51608e10c484e21a451e /lldb/packages/Python/lldbsuite/test/python_api/signals/main.cpp
parentc1c14a227e1391a9ee59000643d4bb96986a135e (diff)
downloadbcm5719-llvm-377aa40d84fefff341525efb2b60a805dbf96c1e.tar.gz
bcm5719-llvm-377aa40d84fefff341525efb2b60a805dbf96c1e.zip
Exponential back off logic for test-and-set lock
This change adds back off logic in the test and set lock for better contended lock performance. It uses a simple truncated binary exponential back off function. The default back off parameters are tuned for x86. The main back off logic has a two loop structure where each is controlled by a user-level parameter: max_backoff - limits the outer loop number of iterations. This parameter should be a power of 2. min_ticks - the inner spin wait loop number of "ticks" which is system dependent and should be tuned for your system if you so choose. The "ticks" on x86 correspond to the time stamp counter, but on other architectures ticks is a timestamp derived from gettimeofday(). The user can modify these via the environment variable: KMP_SPIN_BACKOFF_PARAMS=max_backoff[,min_ticks] Currently, since the default user lock is a queuing lock, one would have to also specify KMP_LOCK_KIND=tas to use the test-and-set locks. Differential Revision: http://reviews.llvm.org/D19020 llvm-svn: 266329
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/signals/main.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud