aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.h
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-01-29 14:38:56 +0100
committerLukas Larsson <[email protected]>2014-02-24 15:16:05 +0100
commitff463a10f37ca74c0b6a8c0e24ce919e56b12bb8 (patch)
treec40571670df39e3397d8c7da4a781659e802fb09 /erts/emulator/beam/erl_process.h
parent31c4876582acf42f77f65f0d822d4d224d642364 (diff)
downloadotp-ff463a10f37ca74c0b6a8c0e24ce919e56b12bb8.tar.gz
otp-ff463a10f37ca74c0b6a8c0e24ce919e56b12bb8.tar.bz2
otp-ff463a10f37ca74c0b6a8c0e24ce919e56b12bb8.zip
ose: Add fair scheduling yields
This is needed on OSs that do not do round robin scheduling of threads.
Diffstat (limited to 'erts/emulator/beam/erl_process.h')
-rw-r--r--erts/emulator/beam/erl_process.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h
index cf20ed5acf..a86ac65aa2 100644
--- a/erts/emulator/beam/erl_process.h
+++ b/erts/emulator/beam/erl_process.h
@@ -607,6 +607,13 @@ extern ErtsAlignedSchedulerData *erts_aligned_dirty_io_scheduler_data;
extern ErtsSchedulerData *erts_scheduler_data;
#endif
+#ifdef ERTS_SCHED_FAIR
+#define ERTS_SCHED_FAIR_YIELD() ETHR_YIELD()
+#else
+#define ERTS_SCHED_FAIR 0
+#define ERTS_SCHED_FAIR_YIELD()
+#endif
+
#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_CHECK)
int erts_smp_lc_runq_is_locked(ErtsRunQueue *);
#endif