diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-10-15 09:07:56 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-10-15 09:07:56 +0000 |
commit | d46df548da44cff511cd0d656a1ec92c4551d653 (patch) | |
tree | 245d02abc67884b9cacde477dda2a87ed602f3d2 | |
parent | a6ba9700a96d623ddac728ed7e4df4ebe32ac99a (diff) | |
download | haskell-d46df548da44cff511cd0d656a1ec92c4551d653.tar.gz |
overlap checking of the black hole queue with waiting for GC threads
-rw-r--r-- | rts/Schedule.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c index 302ec1e7a5..167cac1eab 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -1418,6 +1418,18 @@ scheduleDoGC (Capability *cap, Task *task USED_IF_THREADS, rtsBool force_major) if (gc_type == PENDING_GC_SEQ) { traceSchedEvent(cap, EVENT_REQUEST_SEQ_GC, 0, 0); + } + else + { + traceSchedEvent(cap, EVENT_REQUEST_PAR_GC, 0, 0); + debugTrace(DEBUG_sched, "ready_to_gc, grabbing GC threads"); + } + + // do this while the other Capabilities stop: + if (cap) scheduleCheckBlackHoles(cap); + + if (gc_type == PENDING_GC_SEQ) + { // single-threaded GC: grab all the capabilities for (i=0; i < n_capabilities; i++) { debugTrace(DEBUG_sched, "ready_to_gc, grabbing all the capabilies (%d/%d)", i, n_capabilities); @@ -1440,16 +1452,10 @@ scheduleDoGC (Capability *cap, Task *task USED_IF_THREADS, rtsBool force_major) { // multi-threaded GC: make sure all the Capabilities donate one // GC thread each. - traceSchedEvent(cap, EVENT_REQUEST_PAR_GC, 0, 0); - debugTrace(DEBUG_sched, "ready_to_gc, grabbing GC threads"); - waitForGcThreads(cap); } #endif - // so this happens periodically: - if (cap) scheduleCheckBlackHoles(cap); - IF_DEBUG(scheduler, printAllThreads()); delete_threads_and_gc: |