summaryrefslogtreecommitdiff
path: root/includes/mkDerivedConstants.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-12-01 10:53:28 +0000
committerSimon Marlow <marlowsd@gmail.com>2011-12-01 11:29:53 +0000
commit6d18141d880d55958c3392f6a7ae621dc33ee5c1 (patch)
treeedd5607a50a92ffad4707cef792a06246b5b41e4 /includes/mkDerivedConstants.c
parent1d012e31577951ff5fe74d0277fabdb08c27929d (diff)
downloadhaskell-6d18141d880d55958c3392f6a7ae621dc33ee5c1.tar.gz
Fix a scheduling bug in the threaded RTS
The parallel GC was using setContextSwitches() to stop all the other threads, which sets the context_switch flag on every Capability. That had the side effect of causing every Capability to also switch threads, and since GCs can be much more frequent than context switches, this increased the context switch frequency. When context switches are expensive (because the switch is between two bound threads or a bound and unbound thread), the difference is quite noticeable. The fix is to have a separate flag to indicate that a Capability should stop and return to the scheduler, but not switch threads. I've called this the "interrupt" flag.
Diffstat (limited to 'includes/mkDerivedConstants.c')
-rw-r--r--includes/mkDerivedConstants.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/includes/mkDerivedConstants.c b/includes/mkDerivedConstants.c
index a2c9160e95..6688330a8c 100644
--- a/includes/mkDerivedConstants.c
+++ b/includes/mkDerivedConstants.c
@@ -238,6 +238,7 @@ main(int argc, char *argv[])
struct_field(Capability, no);
struct_field(Capability, mut_lists);
struct_field(Capability, context_switch);
+ struct_field(Capability, interrupt);
struct_field(Capability, sparks);
struct_field(bdescr, start);