Skip to content

Commit

Permalink
overlap checking of the black hole queue with waiting for GC threads
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmar committed Oct 15, 2009
1 parent a6ba970 commit d46df54
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions rts/Schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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:
Expand Down

0 comments on commit d46df54

Please sign in to comment.