Timing measurements.


R. Clayton (rclayton@monmouth.edu)
(no date)


  All of my results match your sample output results with the exception of the
  "add: " count, which appears to be a function of execution time?

Sorta. The idle program spins in a one-instruction loop adding 0 to register
0. Most of the add instructions you see come from the idle program (some are
from user processes executing adds).

  In most cases my 'add' is a bit lower than your examples, in one case your
  'add' is enormously higher than mine (dio-shared.dsk yours = 23,728, mine =
  3,089, all other counts are identical), and in two of them mine are
  substantially higher than yours (ttycopy.dsk/ttycopy.tty and tree.dsk), but
  by a far less margin than the other 'add' differences.

  Is this a function of the different implementations, or does this indicate a
  large error in my programming?

Most likely implementation differences. Your scheduler may be more or less
aggressive than mine is about scheduling ready programs, which would vary the
resulting idle time. Also, the time to execute a disk operation is
proportional to the amount of disk arm movement; the larger the disk arm
movement, the longer the operation takes. Your disk driver may be more or less
cleaver than mine is about optimizing disk arm motion (mine doesn't do any
optimization at all), which again affects the idle time.

  If it an error on my part, can you give me a hint where to look to correct
  it? Am I misinterpreting what 'add' measures?

If you pass all the tests, then you most likely have nothing to worry about.
One group submitted a first assignment that ran with zero idle time for all
tests. It turns out they never bothered to schedule an idle process when there
were no ready processes available, and their os spent its time bouncing between
user space, which caused illegal instruction interrupts (because there was no
code to execute) and the operating system, which ignored the interrupt and
immediately returned to the (nonexistent) user process. However, their code
passed all but one test, so they got a reasonably good grade (of course, if
they don't fix the problem in their second assignment their grade will be
considerably less good).



This archive was generated by hypermail 2.0b3 on Fri Aug 23 2002 - 19:30:04 EDT