From c6d34b4d3e6c7817d066dbe20e9c569ae332d2a6 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 14 Feb 2014 14:39:49 +0100 Subject: ose: Do not use spinlocks on OSE This is because it is very easy to deadlock/livelock inbetween processes on OSE. --- erts/include/internal/ethread.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'erts/include') diff --git a/erts/include/internal/ethread.h b/erts/include/internal/ethread.h index 7307bde8d9..9b1313c538 100644 --- a/erts/include/internal/ethread.h +++ b/erts/include/internal/ethread.h @@ -220,6 +220,7 @@ typedef OSPPDKEY ethr_tsd_key; #define ETHR_HAVE_THREAD_NICENESS #define ETHR_PPC_HAVE_NO_LWSYNC +#undef ETHR_HAVE_NATIVE_SPINLOCKS #else /* No supported thread lib found */ @@ -457,7 +458,11 @@ extern ethr_runtime_t ethr_runtime__; # endif #endif -#ifdef VALGRIND /* mutex as fallback for spinlock for VALGRIND */ +#if defined(VALGRIND) || defined(ETHR_OSE_THREADS) +/* mutex as fallback for spinlock for VALGRIND and OSE. + OSE cannot use spinlocks as processes working on the + same execution unit have a tendency to deadlock. + */ # undef ETHR_HAVE_NATIVE_SPINLOCKS # undef ETHR_HAVE_NATIVE_RWSPINLOCKS #else -- cgit v1.2.3