From 15774d2ac5ba38dba287309f91eb7e4f58b9a636 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Sun, 30 Oct 2011 00:23:16 +0200 Subject: Use critical sections as mutex implementation on Windows Windows native critical sections are now used internally in the runtime system as mutex implementation. This since they perform better under extreme contention than our own implementation. --- erts/emulator/beam/erl_smp.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'erts/emulator/beam/erl_smp.h') diff --git a/erts/emulator/beam/erl_smp.h b/erts/emulator/beam/erl_smp.h index a89ddfbcc1..63179dfad4 100644 --- a/erts/emulator/beam/erl_smp.h +++ b/erts/emulator/beam/erl_smp.h @@ -822,6 +822,16 @@ erts_smp_cnd_wait(erts_smp_cnd_t *cnd, erts_smp_mtx_t *mtx) #endif } +/* + * IMPORTANT note about erts_smp_cnd_signal() and erts_smp_cnd_broadcast() + * + * POSIX allow a call to `pthread_cond_signal' or `pthread_cond_broadcast' + * even though the associated mutex/mutexes isn't/aren't locked by the + * caller. Our implementation do not allow that in order to avoid a + * performance penalty. That is, all associated mutexes *need* to be + * locked by the caller of erts_smp_cnd_signal()/erts_smp_cnd_broadcast()! + */ + ERTS_GLB_INLINE void erts_smp_cnd_signal(erts_smp_cnd_t *cnd) { -- cgit v1.2.3