diff options
author | Milind Changire <mchangir@redhat.com> | 2017-10-18 10:10:38 +0530 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-11-06 12:45:33 +0000 |
commit | e86d71b7b4653ddd66db7f3a16074e46ed24848f (patch) | |
tree | 32304d89118ca984e1a67b4a98a93cb4cea160cd /rpc/rpc-lib/src/rpcsvc-common.h | |
parent | 8aace739fd1aa1b3c1f57d08f86a6180d98f1ef1 (diff) |
rpc: make actor search parallel
Problem:
On a service request, the actor is searched using an exclusive mutex
lock which is not really necessary since most of the time the actor
list is going to be searched and not modified.
Solution:
Use a read-write lock instead of a mutex lock.
Only modify operations on a service need to be done under a write-lock
which grants exclusive access to the code.
Change-Id: Ia227351b3f794bd8eee70c7a76d833cc716ab113
BUG: 1509644
Signed-off-by: Milind Changire <mchangir@redhat.com>
Diffstat (limited to 'rpc/rpc-lib/src/rpcsvc-common.h')
-rw-r--r-- | rpc/rpc-lib/src/rpcsvc-common.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc-common.h b/rpc/rpc-lib/src/rpcsvc-common.h index dd958032336..ab715d3417e 100644 --- a/rpc/rpc-lib/src/rpcsvc-common.h +++ b/rpc/rpc-lib/src/rpcsvc-common.h @@ -42,7 +42,7 @@ typedef struct rpcsvc_state { * other options. */ - pthread_mutex_t rpclock; + pthread_rwlock_t rpclock; unsigned int memfactor; |