diff options
author | dormando <dormando@rydia.net> | 2011-10-02 01:21:52 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2011-11-09 16:06:08 -0800 |
commit | 45e0e9500f11783e227898c7af66a4b5c0057f41 (patch) | |
tree | f9b623edb2f425819157a157d361dfa8f3034fde /assoc.c | |
parent | 67b6bb1d04994e638ccdae6b738e6b960af0858d (diff) | |
download | memcached-45e0e9500f11783e227898c7af66a4b5c0057f41.tar.gz |
Use spinlocks for main cache lock
Partly by Ripduman Sohan
Appears to significantly help prevent performance dropoff from additional
threads, but only when the locks are frequently contested and are short.
Diffstat (limited to 'assoc.c')
-rw-r--r-- | assoc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -205,7 +205,7 @@ static void *assoc_maintenance_thread(void *arg) { /* Lock the cache, and bulk move multiple buckets to the new * hash table. */ - pthread_mutex_lock(&cache_lock); + mutex_lock(&cache_lock); for (ii = 0; ii < hash_bulk_move && expanding; ++ii) { item *it, *next; @@ -264,7 +264,7 @@ int start_assoc_maintenance_thread() { } void stop_assoc_maintenance_thread() { - pthread_mutex_lock(&cache_lock); + mutex_lock(&cache_lock); do_run_maintenance_thread = 0; pthread_cond_signal(&maintenance_cond); pthread_mutex_unlock(&cache_lock); |