The primary index in RAM (question about the mutex lock in the index tree)


#1

I read the aerospike source code for a couple of months, and i have a question about the primary index in RAM, that is , why the as_record_get function(find a node in index by a given key) and as_record_get_create function(first get a node by a given key,if it do not exist then create a node in the tree with the given key) both of them use pthread_mutex_lock(&tree->lock); does it a high performance way? the read requests blocks with each other, why not let the read(find a node in index) request share the tree with each other?