XML

kent logo

CO527 Anonymous Questions and Answers

This page lists the various questions and answers. To submit a question, use the anonymous questions page. You may find the keyword index and/or top-level index useful for locating past questions and answers.

We have taken the liberty of making some minor typographical corrections to some of the questions as originally put. Although most of the questions here will have been submitted anonymously, this page also serves to answer some questions of general interest to those on the course.


Question 15:

Submission reference: IN5008

Hi, I've seen this error on the anonymous page however I still am not quite sure what is causing this. This error only occurs when I run the request-big.txt, running the smaller one is fine.

I had a thought that maybe the read-queue is limited to a set size and loops around causing my code to read all values from the tail when it resets back to position 0 upto DiskSim.MAXREQUESTS however all the old values in the readqueue may not be getting removed and just being read again?

raptor$ java DiskSim --file requests-big.txt
highlevel_didread(): read queue 34 got unexpected block 6784807
highlevel_didread(): read queue 19 got unexpected block 431139
[snip]

Answer 15:

Yes, something is going wrong when your request queue is full. Essentially this is a bug that you need to understand and fix (debugging!). I'm happy for you to pop along to my office and I can see if I can give you some pointers as to where the error lies (without giving too much away).

Keywords: assess4-1516


Question 14:

Submission reference: IN5001

Question about the seek time.

A disk arm must first find the right head ,then the right track and then get the right block.

For most disks as the inward heads are typically smaller than the outermost. The current implementation does keep track of head and tracks and sectors however there is no method/function to determine the direction of the arm. E.g. go inward or go outward? Since the most important thing here is timing don't we need a function to determine the direction?

I am referring to the C-Look algorithm so direction function is very important I think.

Answer 14:

Don't overcomplicate things. You don't need a function for this — why not just a variable? (rather, a field/attribute added to the DSched class).

Keywords: assess4-1516

Referrers: Question 16 (2015)


Question 13:

Submission reference: IN5003

Hi, I've not seen this syntax before, could you explain what the ".blk" does in "readqueue[readqueue_head].blk = blk;" please?

Answer 13:

It's exactly the same as it is elsewhere in Java — accessing a field/attribute/data/method (whatever your preferred nomenclature) in an object. Thus "blk" is just some public field of the relevant object. The way you've been taught would probably be to set this using a mutator, but in this sort of code, that just complicates things unnecessarily (and introduces unwanted overhead). Bear in mind that C would be the more normal language to program this stuff in: I'm only using Java because it's the language you know.

Keywords: assess4-1516


Question 12:

Submission reference: IN5005

For assessment 4, are we explicitly bound to implementing a pre-existing algorithm (c-scan for example), or are we allowed to invent our own.

Basically is the aim of the assessment to implement something specific, or as long as we improve the efficiency of the provided code we pass?

Answer 12:

The criteria for marking are clearly described in the assessment description. Any algorithm, provided it improves things, will pass. For a decent mark, however, you should be aiming to improve on SSTF at least (as that has some caveats that are explained in the slide-deck, and elsewhere).

Keywords: assess4-1516 , disk-scheduling


Question 11:

Submission reference: IN4999

Hi, I think I have a working c-look implementation with the following results:

[snip program output]

Is this what would be expected with a c-look algorithm?

Answer 11:

Depends on the dataset and your particular implementation. I'd suggest feeding your code to the automated checker here: https://www.cs.kent.ac.uk/studash/co527.php and see what that says! (should be better than SSTF in most, if not all, cases).

Keywords: assess4-1516


Question 10:

Submission reference: IN5000

Hi, I've just gone to use the CO527 disk-scheduling online automated test and I'm getting this error:

Sorry, you are not allowed to submit files masquerading as a student.

Answer 10:

Please try it again! (I think I've fixed it, but since I'm not a student, I cannot actually test it as as student).

Keywords: assess4-1516


Question 9:

Submission reference: IN4998

Can we use java.lang.Integer?

Answer 9:

No. (the obvious question being, why would you need or want to?)

Keywords: assess4-1516


Question 8:

Submission reference: IN4997

Can we use "Math.abs()" in the disk scheduler assessment?

Answer 8:

Yes, that's fine (but only on the grounds that it's trivial and can be written inline). E.g.:

    int av = Math.abs (v);

Could just as easily (and probably more efficiently) be written:

    int av = (v < 0) ? -v : v;

Keywords: disk-scheduling , assess4-1516

Referrers: Question 45 (2015)


Question 7:

Submission reference: IN4984

Right after a rough attempt at implementing the C-Look algorithm, I got some errors out that I can't understand. Could you explain them to me?

highlevel_didread(): read queue 0 got unexpected block 1
highlevel_didread(): read queue 0 got unexpected block 1
highlevel_didread(): read queue 0 got unexpected block 1025
highlevel_didread(): read queue 11 got unexpected block 2218500
[snip]

finished at time 2017 with 11 pending queues
disk spent 31 idle, 1588 seeking to track, 398 reading 76 blocks
*** had 35 logical errors!
time for request in queue (min, max, avg): 0	, 1780 , 709.9	+/- 616.1
time for request in read (min, max, avg):  4	, 180  , 34.1  +/- 46.0
time for request total (min, max, avg):    4	, 1818 , 744.0	+/- 606.4

Score value: 1350

Answer 7:

These errors mean some high-level read-queue (0 and 11 shown here) got back a block it hadn't requested. Hence, unexpected block error. This means your code is returning a block that hadn't been requested (or, possibly, had been requested in the past and already returned, so this is a duplicate).

Keywords: disk-scheduling


Question 6:

Submission reference: IN4979

Sorry if this is stupid question but do OSs have the concept of 2D arrays?

Answer 6:

Yes, they do (as in "int blargh[][] = new int[10][12];" kinda thing). No "ArrayList"s or similar high-level artefacts however.


Question 5:

Submission reference: IN4966

Question about the C-Look algorithm: Where does the read/write head actually start? Is it on a random track and then goes down to the nearest end and jumps and continues, or does it start as a preset position?

Answer 5:

The source code is available, look for yourself! (initially the head will be on track 0).

Keywords: assess4-1516


Question 4:

Submission reference: IN4957

Looking at the disk scheduling assessment; am I right in thinking that we only just have to edit the readcomplete method of the DSched class (and add others if we need them)?

Answer 4:

There are many possible ways of implementing this — you can probably get away with just editing this method, but I'd recommend changes elsewhere if you're starting from the FIFO version of the code (else you've got all this circular queue stuff in there that's redundant).

Keywords: disk-scheduling , assess4-1516


Question 3:

Submission reference: IN4905

When will the marks for assessment one be uploaded on SDS?

Answer 3:

They should be there already (i.e. I sent them to CAS some time ago). But it seems not. Will chase tomorrow (they have been busy with other things just recently).


Question 2:

Submission reference: IN4809

In the Preliminary test for Operating Systems and Architectures you spelt "Nybble" as "Nibble". Would it matter which way it was written? Or was this just a typo?

Answer 2:

I've always spelled it "nibble". Foldoc suggests that "nibble" is the more accepted spelling, since UK denizens will try and pronounce "ny" as "nigh".


Question 1:

Submission reference: IN1862

What is the average air-speed velocity of an unladen student?

Answer 1:

About 145 m/s.

Valid CSS!

Valid XHTML 1.0!

Maintained by Fred Barnes, last modified Wed May 25 15:07:19 2016