diff options
author | Rickard Green <[email protected]> | 2011-11-18 12:18:08 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2011-11-18 12:18:08 +0100 |
commit | c4bba16b943db225715c0aed1944bb1190ec352a (patch) | |
tree | a711068cbce25a9237f81b315867d2d934547aec /erts/emulator/beam/erl_process_lock.h | |
parent | 6214fde94809079d1764e4273886544272784eb3 (diff) | |
download | otp-c4bba16b943db225715c0aed1944bb1190ec352a.tar.gz otp-c4bba16b943db225715c0aed1944bb1190ec352a.tar.bz2 otp-c4bba16b943db225715c0aed1944bb1190ec352a.zip |
Replace spinlock with mutex as pix_lock implementation
The spinlocks used implementing pix-locks have been replaced with
mutexes since they perform better during heavy contention.
Diffstat (limited to 'erts/emulator/beam/erl_process_lock.h')
-rw-r--r-- | erts/emulator/beam/erl_process_lock.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_process_lock.h b/erts/emulator/beam/erl_process_lock.h index 97f250138e..97e554914e 100644 --- a/erts/emulator/beam/erl_process_lock.h +++ b/erts/emulator/beam/erl_process_lock.h @@ -255,8 +255,8 @@ void erts_proc_lc_unrequire_lock(Process *p, ErtsProcLocks locks); typedef struct { union { - erts_smp_spinlock_t spnlck; - char buf[64]; /* Try to get locks in different cache lines */ + erts_mtx_t mtx; + char buf[ERTS_ALC_CACHE_LINE_ALIGN_SIZE(sizeof(erts_mtx_t))]; } u; } erts_pix_lock_t; @@ -380,18 +380,18 @@ ERTS_GLB_INLINE void erts_proc_lock_op_debug(Process *, ErtsProcLocks, int); ERTS_GLB_INLINE void erts_pix_lock(erts_pix_lock_t *pixlck) { ERTS_LC_ASSERT(pixlck); - erts_smp_spin_lock(&pixlck->u.spnlck); + erts_mtx_lock(&pixlck->u.mtx); } ERTS_GLB_INLINE void erts_pix_unlock(erts_pix_lock_t *pixlck) { ERTS_LC_ASSERT(pixlck); - erts_smp_spin_unlock(&pixlck->u.spnlck); + erts_mtx_unlock(&pixlck->u.mtx); } ERTS_GLB_INLINE int erts_lc_pix_lock_is_locked(erts_pix_lock_t *pixlck) { - return erts_smp_lc_spinlock_is_locked(&pixlck->u.spnlck); + return erts_lc_mtx_is_locked(&pixlck->u.mtx); } /* |