diff options
author | Simon Marlow <marlowsd@gmail.com> | 2008-09-19 10:26:01 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2008-09-19 10:26:01 +0000 |
commit | 8f52645bd99ee3e636a34826c0cbfc5939920da1 (patch) | |
tree | a1664a93c679eed383facbbcba26334ddfe398c4 /rts/Capability.h | |
parent | 09bb1eb4d782fd67c36145fd230bcb201d1548ba (diff) | |
download | haskell-8f52645bd99ee3e636a34826c0cbfc5939920da1.tar.gz |
Move the context_switch flag into the Capability
Fixes a long-standing bug that could in some cases cause sub-optimal
scheduling behaviour.
Diffstat (limited to 'rts/Capability.h')
-rw-r--r-- | rts/Capability.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rts/Capability.h b/rts/Capability.h index 94306eb6c0..70d9ee9e8d 100644 --- a/rts/Capability.h +++ b/rts/Capability.h @@ -66,6 +66,10 @@ struct Capability_ { // each GC. bdescr **mut_lists; + // Context switch flag. We used to have one global flag, now one + // per capability. Locks required : none (conflicts are harmless) + int context_switch; + #if defined(THREADED_RTS) // Worker Tasks waiting in the wings. Singly-linked. Task *spare_workers; @@ -232,6 +236,9 @@ extern void grabCapability (Capability **pCap); #endif /* !THREADED_RTS */ +// cause all capabilities to context switch as soon as possible. +void setContextSwitches(void); + // Free a capability on exit void freeCapability (Capability *cap); |