[comp.os.minix] A Couple of Clock Task Questions

busch@sdsu.sdsu.edu (Richard Busch) (06/11/90)

I'm new to Minix and to this newsgroup, so please forgive me if these
questions have been discussed before. I'm working from The Book and
the Atari-ST sources from Prentice-Hall . . .

1st question: The procedure 'sched' (in proc.c) is called only by
'do_clocktick,' which is part of the clock task. That means that
'sched' executes only when the current process is the clock task.
As part of its work, 'sched' calls 'pick_proc.' But since the clock
task is the thing that's running, its at the head of the task queue.
So the clock task gets reselected by 'pick_proc.' Thus, in this context
'pick_proc' does not select a different task to run (and its a good 
thing, too -- you don't want to change 'cur_proc' while a process is
running). So why does 'sched' call 'pick_proc'?

2nd question: Assume that some 'lost_ticks' have been accumulated.
When 'do_clocktick' is finally executed, it correctly updates the
value in 'realtime,' but when 'accounting' is called, the user/system
accounting time is incremented by one rather than by the number of
lost ticks. Why is that? It seems that some accounting information is
thereby being lost.

Thanks, in advance, for all replies.

=======================================================================
Richard Busch         San Diego State University         busch@sdsu.edu
=======================================================================