
Hello Simon, Tuesday, January 03, 2006, 7:43:21 PM, you wrote:
The minimum time between context switches is 20 milliseconds.
Is there any good reason why 0.02 seconds is the best that you can get here? Couldn't GHC's internal timer tick at a _much_ faster rate (like 50-100µs or so)?
SM> Sure, there's no reason why we couldn't do this. Of course, even SM> idle Haskell processes will be ticking away in the background, so SM> there's a reason not to make the interval too short. What do SM> you think is reasonable? Simon, the talk is about changing GHC _tick_, which is a _minimal_ possible context switch interval. so, we want to decrease this tick and retain current 20 ms _default_ switch interval. this will make possible to decrease switch interval for programs that really need it, which is currently entirely impossible. -C[<us>]: Sets the context switch interval to <s> seconds. A context switch will occur at the next heap block allocation after the timer expires (a heap block allocation occurs every 4k of allocation). With -C0 or -C, context switches will occur as often as possible (at every heap block allocation). By default, context switches occur every 20ms milliseconds. Note that GHC's internal timer ticks every 20ms, and the context switch timer is always a multiple of this timer, so 20ms is the maximum granularity available for timed context switches. -- Best regards, Bulat mailto:bulatz@HotPOP.com