Instead of a separate context-switch flag, set HpLim to zero
authorSimon Marlow <marlowsd@gmail.com>
Fri, 13 Mar 2009 10:45:16 +0000 (10:45 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 13 Mar 2009 10:45:16 +0000 (10:45 +0000)
commit304e7fb703e7afddc1ef9be6aab6505e36b63b06
tree578332aa77e0c1c2d176218d23ae0beb0afd98af
parentc197fe602ed4aadf09affe0cdc18e7158d262012
Instead of a separate context-switch flag, set HpLim to zero
This reduces the latency between a context-switch being triggered and
the thread returning to the scheduler, which in turn should reduce the
cost of the GC barrier when there are many cores.

We still retain the old context_switch flag which is checked at the
end of each block of allocation.  The idea is that setting HpLim may
fail if the the target thread is modifying HpLim at the same time; the
context_switch flag is a fallback.  It also allows us to "context
switch soon" without forcing an immediate switch, which can be costly.
includes/MachRegs.h
includes/Regs.h
rts/Capability.c
rts/Capability.h
rts/HeapStackCheck.cmm
rts/Interpreter.c
rts/PrimOps.cmm
rts/Schedule.c
rts/StgStartup.cmm
rts/Threads.c
rts/posix/Signals.c