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 181:

Submission reference: IN1148

hi can you give me a few pointers as to where i'm goin wrong. as i've hit a bit of a wall. is there anything thats right here....?

  [snip code]

Answer 181:

Some things there are right, but a lot of it is unnecessary. Aside from that, there are two problems with the code, which will prevent it from working correctly — Question 180 (2006) covers both of them.

Keywords: coursework


Question 182:

Submission reference: IN1152

Hey, I'm having some trouble with my programme hanging, much like in Question 165 (2006) I think, however I cannot see where its going wrong :(. Any hints?

  [snip code]

Merci Bucket

Answer 182:

You actually need to remove the request from the request_queue array, not merely set its contents to null. This should obviously not work, since if you NULL an item and decrement rq_count, then the next time your loop gets called, it may not get around to examining all valid requests (because they are at indices rq_count or greater in the array). Furthermore, the code that puts requests in that array in the first place (in DiskSchedulerFIFO), does so at index rq_count, so would potentially overwrite another valid request.

Keywords: coursework


Question 183:

Submission reference: IN1160

Hi Fred. I have this code currently as a solution. I know that the way I have worked out distances could probably be improved, and that the last part would probably be done best using System.arraycopy, but I just wanted to check that my current code is doing the correct thing, i.e. returning the requests closest the the current cylinder location. This is it:

  [snip code]

Thanks.

Answer 183:

Do you think that your code does the right thing? I'll tell you for sure when I come to mark it. I'm generally against the repeated submission of code with "is this correct?"; what's the point in having deadlines or counting coursework if we're going to give repeated opportunities for you to get it right — in the real world, you have to get it right first time. University is good practice for this. :-). Besides which, it takes me long enough to mark these assessments just once; doing so many times is just not economical! On the other hand, I can't see anything obviously wrong with your code, save for some redundancy.

Keywords: coursework


Question 184:

Submission reference: IN1165

Hi Fred, I was wondering about how to solve the first part of this assessment. Am I correct in thinking we need to use the int[] getGeom() method in the DiskDevice class ? Thanks

Answer 184:

Yes, that's correct.

Keywords: coursework

Referrers: Question 185 (2006)


Question 185:

Submission reference: IN1166

For section 1 of this current assignment, I have the following code:

  super.ddev.getGeom();

Is it just a case of assigning the correct variable to a part of the array returned by that method ?

Answer 185:

Don't use "super." for this; you don't need to! If you look in DiskSchedulerFIFO, you'll see that the 'ddev' attribute is protected, and so is visible by inheritance. See also Question 178 (2006) and Question 184 (2006).

Keywords: coursework


Question 186:

Submission reference: IN1167

For the first two parts of this assignment, do I simply need :

  [snip code]

Thanks

Answer 186:

Pretty much, yes. See Question 167 (2006).

Keywords: coursework


Question 187:

Submission reference: IN1168

Fred, I am currently undertaking the last part of the assessment. However, I cannot see how I can access a cylinder's distance, and so determine which cylinder is the nearest. I would appreciate any pointers you could provide. Many Thanks

Answer 187:

There's a method in the DiskDevice interface that returns the CHS values for a given block number. Each request structure contains a block number. You should be able to combine these to get the cylinder for each request, and combined with the cylinder of the last dispatched request, get the distance to each request.

Keywords: coursework


Question 188:

Submission reference: IN1169

Slightly off topic but I was wondering how we could get rid of these unsafe and unchecked operation warnings:

  $ javac *.java
  Note: BoundedBuffer.java uses unchecked or unsafe operations.
  Note: Recompile with -Xlint:unchecked for details.

Thanks

Answer 188:

Ask Sun to fix Java :-). There is no simple fix for this one..

Keywords: coursework


Question 189:

Submission reference: IN1176

When do we get our marks back from the architecture quiz?

Answer 189:

Marks should appear in the student data-system soon.

Keywords: coursework


Question 190:

Submission reference: IN1173

Where can I find the exam rubrics please — I am off-campus? thanks.

Answer 190:

Are you off-campus? (I don't know!). The rubrics for all CS papers can be found on the CS website: http://www.cs.kent.ac.uk/teaching/.

Keywords: exam

Referrers: Question 220 (2006)


Question 191:

Submission reference: IN1181

Hi Fred, I have a couple of questions about lecture 3 — "Concurrency, Semaphores and Spinlocks".

  1. When sent a "wait", if the number if decreased what effect does this actually have? I understand when it reaches 0 that it is then waiting, however what does decreasing actually achieve? Why not set it straight to 0?

  2. Does mutual-exlusion offer concurrent read? I'm guessing not?

  3. Are we expected to learn the assembler(?) code you have in there for the exam? Or even be able to replicate any of the Java code, beyond having an understanding of how it works at a high level? Further, and slightly off-topic, will we be tested on the material you didn't have time to cover in the lectures?

Thanks!

Answer 191:

In answer to your questions:

  1. See one of the course text-books. These will explain semaphores in more detail than I'd care to go into here. There's also a wealth of information on-line; have you tried looking at Wikipedia or suchlike?

  2. Correct, as the term mutual exclusion suggests, only one process at one time can have access to the resource — irrespective of whether it's a reader, writer or something else.

  3. Learning the assembler code by rote would be fairly pointless, unless you actually understand what it's doing. Similar with replication of Java code. Regurgitating parts of the lecture slides in the exams will attract less marks than demonstrating that you actually understand the concepts. It would be reasonable to ask you to 'sketch' the semaphore wait or signal algorithm, for example, which could be done with either pseudo-code or a diagram. As far as lectured material goes, you will only be examined on things covered in the lectures — which may be less or more than the slides contain. Hence the value of turning up to lectures and actively making your own notes :-).

Keywords: semaphore , spinlock , exams


Question 192:

Submission reference: IN1183

Hi Fred, what is the difference between semaphores and spinlocks when used for mutual exclusion? why would you want the 'wait' operation to be aborted? Could you give me a definition of 'blocking'?

Answer 192:

I'm not going to blindly answer my own past exam questions here.. :-). I'd suggest that you start by reading up on semaphores and spinlocks (from the lecture slides, textbooks, and your own notes). As for a definition of 'blocking', well, um, it means that something blocks (a crude analogy would be a flow of water in a pipe being 'blocked' by a bung). Information relating to processes and process states will be relevant reading (there is a process state transition labelled "block" in the notes).

If you want slightly more helpful advice on past exam questions, submit your attempt at an answer and I'll give feedback — that will aid your own learning and understanding significantly more than me just providing my model answers to these questions. Meeting up with your peers and going through past exam questions is a good way forward.

Keywords: semaphore , spinlock

Referrers: Question 195 (2006)


Question 193:

Submission reference: IN1179

Will there by any chance be a mock exam paper available this year?

Answer 193:

Nope — use the past exam papers; the only thing that's really changed from last year is the rubric.

Keywords: exams


Question 194:

Submission reference: IN1186

I would like to find out why the results of the quiz test are still not released? and when they will be?

Answer 194:

The marks will appear in CAS in due course. I've tried pushing some buttons in WebCT, so your results may appear there too (or might not).

Keywords: coursework


Question 195:

Submission reference: IN1187

Why is it the university's policy to not give answers to past exam papers? I don't understand the concept of not getting any feedback on your exams apart from just the mark. Surely it would help us to know what we have answered incorrectly so we could learn from our errors? Also what's so wrong about being able to look at past exam papers, but not the answers? Cheers

Answer 195:

There are two aspects to this. Firstly, giving feedback on exam answers is just not practical. There's a very limited amount of time from when we get the scripts to the time when the marks have to be in, which includes them having been second-marked by another examiner. Each question takes around 10-15 minutes to mark, which for a module with 150 students, means about 4 days solid marking per question. We have other things to do as well, besides marking exams.. (such as doing research, writing research proposals, collaborating with other researchers, attending examination boards, sorting out overall final module marks, preparing modules for next year, reviewing and evaluating modules for this year, analysing student feedback, and various other things; and some of us may want a holiday of some kind at some point..).

Secondly, giving you the model solutions to past exam questions is unlikely to be that useful to you pedagogically. There may be more than one "right" answer to a question, but we only write one model solution (for the purposes of first and second marking, and for the external examiner). If a students incorrectly interprets a question (which does tend to happen), they may still get the marks if the interpretation was reasonable (i.e. the question could have been worded better). If you misinterpret the question, you won't necessarily understand the model answer.

If you want to know what you might have gotten wrong in an exam, I'd suggest taking the question paper from the exam and spending a couple of hours with it, relevant text-books and your notes. What you wrote down in the exam should be fairly fresh in your mind, at least for the rest of the same day. In my experience, most students can't be bothered to do this (the more diligent ones will do).

As a last point, if you do want feedback, email your lecturers with you attempts at answers and most will be happy to provide some sort of feedback. But as I mentioned in Question 192 (2006), don't just ask the exam questions; we won't give you the answers you want.

Keywords: exams


Question 196:

Submission reference: IN1188

Are any of the questions in the exam based on the programming exercises assigned?

Answer 196:

Possibly — but you will not be asked to write Java code in the exam.

Keywords: exams


Question 197:

Submission reference: IN1189

I am looking around for "crewlock" but the only thing I have found is the 'crelock' library in Java. Can you please explain me how it works and its difference from the semaphores? Thanks

Answer 197:

I couldn't find any "crelock" class in the Java API reference.. CREW locks are an application of semaphores (at least in the way I showed in the lectures), it doesn't make a huge amount of sense to compare them directly (like comparing cake and flour). There should be plenty of relevant material on these locks, however — it's a mechanism that allows multiple concurrent readers or a single exclusive writer (CREW = concurrent read exclusive write). I won't attempt to explain in detail how different versions of the algorithm work, however — see text-books, etc.

Keywords: semaphore


Question 198:

Submission reference: IN1191

I was looking around for "cache-line ping-pong" and I found [spinlock]. which seems that was answered by you :P... I would like a clarification please, for the part of the question 18 about "cache-line ping-pong": does "cache-line ping-pong" occur due to synchronization of the 2 caches of the 2 processors? Thanks. PS:Even if the answer was not given by you answer my question :D

Answer 198:

Yes, cache-line ping-pong does arise as a result of the two processor caches synchronising (because they both contain and are updating the same memory address).

Keywords: spinlock


Question 199:

Submission reference: IN1190

When are we going to get the marks for the last programming assessment back? Thanks

Answer 199:

You'll get them back in week 25 sometime (ideally one working week since the deadline in week 24). I wanted to get them marked during the holidays, but have been extremely busy with other things unfortunately..

Keywords: coursework


Question 200:

Submission reference: IN1193

Is there going to be a revision session for this module at the beginning of next term ?

Answer 200:

You're the first to ask about this (I think); they don't happen automatically. I've asked the admin to try and book a lecture theatre at some point during the first week, and will inform the group when/if something gets arranged. Given the scheduling of exams, it might be the case that not everybody can be available. I don't have any material specifically prepared, so best to let me know in advance, via these anonymous questions pages, what areas in particular you want me to cover (of the OS material lectured).

Here are the topics requested so far:

These things were requested but there may not be enough time to cover them:

Keywords: exams

Referrers: Question 209 (2006)

Valid CSS!

Valid XHTML 1.0!

Maintained by Fred Barnes, last modified Thu May 8 12:58:00 2014