[s2156593@cse.unsw.edu.au (Binh Thai) writes:]
> In the file sched.c, there is a parameter called RUN_TICKS, which is
>set to Hz/4. I have found out from another file that Hz = 20. This makes
>RUN_TICKS = 5. What does that 5 means? Is it 5ms? 5 clock cycles? or
>5Hz = 0.2s?
HZ defines the rate at which the system clock ticks. Each clock tick
results in hardclock() being called. hardclock(), among other things,
decrements the current running thread's (if any) t_runticks counter, which
starts at RUN_TICKS and counts down. When it reaches zero, the process is
flagged to consider being preempted.
RUN_TICKS, therefore, is in units of clock ticks. It is the granularity at
which CPU bound processes will be timesliced among each other. Interactive
tasks, on the other hand, generally do not run long enough to expire this
count, and the "cheated" runtime queue lets such sporadic tasks receive a
much more favorable scheduling treatment. You should also consider the role
of the t_oink field, as it is important in correctly detecting processes
which should receive this preferential treatment.
Andy
Received on Thu Oct 2 17:18:44 1997
This archive was generated by hypermail 2.1.8 : Thu Sep 22 2005 - 15:12:43 PDT