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/posix | |
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/posix')
-rw-r--r-- | rts/posix/Itimer.c | 4 | ||||
-rw-r--r-- | rts/posix/Select.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/rts/posix/Itimer.c b/rts/posix/Itimer.c index 83ed84d6ef..0f0b1e977e 100644 --- a/rts/posix/Itimer.c +++ b/rts/posix/Itimer.c @@ -221,6 +221,6 @@ getourtimeofday(void) struct timeval tv; gettimeofday(&tv, (struct timezone *) NULL); // cast to lnat because nat may be 64 bit when int is only 32 bit - return ((lnat)tv.tv_sec * TICK_FREQUENCY + - (lnat)tv.tv_usec * TICK_FREQUENCY / 1000000); + return ((lnat)tv.tv_sec * 1000 / RtsFlags.MiscFlags.tickInterval + + (lnat)tv.tv_usec / (RtsFlags.MiscFlags.tickInterval * 1000)); } diff --git a/rts/posix/Select.c b/rts/posix/Select.c index 0dbacef7a8..ccf39458d2 100644 --- a/rts/posix/Select.c +++ b/rts/posix/Select.c @@ -126,7 +126,7 @@ awaitEvent(rtsBool wait) min = 0; } else if (sleeping_queue != END_TSO_QUEUE) { min = (sleeping_queue->block_info.target - ticks) - * TICK_MILLISECS * 1000; + * RtsFlags.MiscFlags.tickInterval * 1000; } else { min = 0x7ffffff; } |