summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorAndreas Voellmy <andreas.voellmy@gmail.com>2012-12-22 19:38:21 -0500
committerJohan Tibell <johan.tibell@gmail.com>2013-02-11 21:38:36 -0800
commit24733b8f9bf27b2ebaf06a411a8bd95a01138651 (patch)
tree99b3c92a1e42267408eac2ce0e8b03a7dd1a65fe /rts
parent38a5902fec5ca7b078f607cc4e7452f1c62214f7 (diff)
downloadhaskell-24733b8f9bf27b2ebaf06a411a8bd95a01138651.tar.gz
setNumCapabilities calls GHC.Conc.IO.ioManagerCapabilitiesChanged before returning.
This enables the IO manager to change the number of IO loops it uses (usually one per capability).
Diffstat (limited to 'rts')
-rw-r--r--rts/Prelude.h1
-rw-r--r--rts/Schedule.c8
-rw-r--r--rts/package.conf.in1
3 files changed, 10 insertions, 0 deletions
diff --git a/rts/Prelude.h b/rts/Prelude.h
index e0b87e067a..dcd7b94da4 100644
--- a/rts/Prelude.h
+++ b/rts/Prelude.h
@@ -45,6 +45,7 @@ PRELUDE_CLOSURE(base_ControlziExceptionziBase_nestedAtomically_closure);
PRELUDE_CLOSURE(base_GHCziConcziSync_runSparks_closure);
PRELUDE_CLOSURE(base_GHCziConcziIO_ensureIOManagerIsRunning_closure);
+PRELUDE_CLOSURE(base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure);
PRELUDE_CLOSURE(base_GHCziConcziSignal_runHandlers_closure);
PRELUDE_CLOSURE(base_GHCziTopHandler_flushStdHandles_closure);
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 5f48ef633c..7eaaba2483 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -2067,6 +2067,14 @@ setNumCapabilities (nat new_n_capabilities USED_IF_THREADS)
stgFree(old_capabilities);
}
+ // Notify IO manager that the number of capabilities has changed.
+ rts_evalIO(
+ &cap,
+ rts_apply(cap,
+ &base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure,
+ rts_mkInt(cap, enabled_capabilities)),
+ NULL);
+
rts_unlock(cap);
#endif // THREADED_RTS
diff --git a/rts/package.conf.in b/rts/package.conf.in
index ee964db711..375151367e 100644
--- a/rts/package.conf.in
+++ b/rts/package.conf.in
@@ -101,6 +101,7 @@ ld-options:
, "-u", "_base_GHCziTopHandler_runIO_closure"
, "-u", "_base_GHCziTopHandler_runNonIO_closure"
, "-u", "_base_GHCziConcziIO_ensureIOManagerIsRunning_closure"
+ , "-u", "_base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure"
, "-u", "_base_GHCziConcziSync_runSparks_closure"
, "-u", "_base_GHCziConcziSignal_runHandlers_closure"
#else