diff options
author | Ian Lynagh <igloo@earth.li> | 2006-09-05 14:15:45 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2006-09-05 14:15:45 +0000 |
commit | 93db1991b5cacf8357493a2e17fbbfb485f3205b (patch) | |
tree | 4a9ebcc89dfbf9a106d42ec63b764cc7d0abdce2 /rts/Timer.c | |
parent | c18587da71e16b581c293baee8d4af119b108da7 (diff) | |
download | haskell-93db1991b5cacf8357493a2e17fbbfb485f3205b.tar.gz |
new RTS flag: -V to modify the resolution of the RTS timer
Fixed version of an old patch by Simon Marlow. His description read:
Also, now an arbitrarily short context switch interval may now be
specified, as we increase the RTS ticker's resolution to match the
requested context switch interval. This also applies to +RTS -i (heap
profiling) and +RTS -I (the idle GC timer). +RTS -V is actually only
required for increasing the resolution of the profile timer.
Diffstat (limited to 'rts/Timer.c')
-rw-r--r-- | rts/Timer.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/rts/Timer.c b/rts/Timer.c index 90f89b1c06..d56fdb656f 100644 --- a/rts/Timer.c +++ b/rts/Timer.c @@ -54,20 +54,22 @@ handle_tick(int unused STG_UNUSED) #if defined(THREADED_RTS) /* - * If we've been inactive for idleGCDelayTicks (set by +RTS + * If we've been inactive for idleGCDelayTime (set by +RTS * -I), tell the scheduler to wake up and do a GC, to check * for threads that are deadlocked. */ switch (recent_activity) { case ACTIVITY_YES: recent_activity = ACTIVITY_MAYBE_NO; - ticks_to_gc = RtsFlags.GcFlags.idleGCDelayTicks; + ticks_to_gc = RtsFlags.GcFlags.idleGCDelayTime / + RtsFlags.MiscFlags.tickInterval; break; case ACTIVITY_MAYBE_NO: if (ticks_to_gc == 0) break; /* 0 ==> no idle GC */ ticks_to_gc--; if (ticks_to_gc == 0) { - ticks_to_gc = RtsFlags.GcFlags.idleGCDelayTicks; + ticks_to_gc = RtsFlags.GcFlags.idleGCDelayTime / + RtsFlags.MiscFlags.tickInterval; recent_activity = ACTIVITY_INACTIVE; blackholes_need_checking = rtsTrue; /* hack: re-use the blackholes_need_checking flag */ @@ -81,17 +83,17 @@ handle_tick(int unused STG_UNUSED) } int -startTimer(nat ms) +startTimer(void) { #ifdef PROFILING initProfTimer(); #endif - return startTicker(ms, handle_tick); + return startTicker(RtsFlags.MiscFlags.tickInterval, handle_tick); } int -stopTimer() +stopTimer(void) { return stopTicker(); } |