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:

In the lecture slides you describe the semaphore operations (wait & signal) to be indivisible. You also mention that to guarantee that these operations are indivisible, the implementation requires indivisible access to memory. What exactly do you mean by "indivisible" in each of these instances ?

Answer 181:

In essence, I'm referring to its literal meaning, "not divisible" (in both cases). Put in context, indivisible memory access means that if two or processors write to the same memory location, one will always "win" -- i.e. the resulting data in memory will be one of the values written, not some unpleasant mangling of data (the result of a race-condition). For some operations (e.g. an atomic increment) the indivisibility extends over a memory read and a memory write at the same location. Some hardware support is needed to do this (e.g. PC-style shared-memory architectures have a "lock" wire coming out of the processor, allowing one processor exclusive access to all memory -- and the bus in general). At this level, people often talk about "atomic" memory accesses, rather than "indivisible" accesses.

Similar thinking, but a different implementation, exists for whole semaphore operations. If you ran two "wait" or "signal" algorithms concurrently without locking, the result would probably be wrong. But it's not sensible to lock all of memory for the whole operation (prevents anything else from happening pretty much) -- besides, Intel chips won't let you do it; you can only "lock" certain instructions. I talked through the race-hazard(s) a bit in the lecture I think.

Keywords: atomic


Question 182:

Other uses apart from in aiding concurrency, I'm not too sure what these are, any help appreciated.

Answer 182:

You'll have to provide a bit more context.. lots of things aid concurrency.


Question 183:

Hi, I've just got a couple of questions about monitors...

Am I right in saying that there are 2 sets, one which consists of those processes which are blocked on the lock, and the wait-set?

Also, on the slides you mention that "unlike a semaphore, user-code can execute inside the 'lock'". With semaphores, a process claims the lock with a wait() then runs it's critical code then releases with signal(). With monitors a process claims the lock, runs it's critical code then releases the lock. So, how do they not both run user-code inside the lock?

Thanks!

Answer 183:

Yes, there are two sets of processes associated with a monitor.

The lock associated with semaphore operations is entirely internal; this is separate from the application of the semaphore for mutual exclusion (which would be an application-level lock). However, the lock associated with monitors is entirely external, done with "synchronized" blocks in Java. Thus, any code (other than wait/notify/notifyAll) inside a "synchronized" block is user-code inside the 'lock'.

Keywords: monitors


Question 184:

In the slides on spooling (lect 9: 13-14) you mention in several places that privileged processes do something then notify the spooler but you never seem to say what the spooler actually does?

Answer 184:

The first slides hint at what the spooler does, I would have mentioned it more explicitly in the lecture. Basically the spooler is a program (or process) that multiplexes requests for the spooled device from users. A familiar example is "lpd", which is a commonly used print spooler on UNIX systems. "CUPS" (common unix print system) may be found on some systems instead of "lpd" -- both have their strengths and weaknesses.

Keywords: spooling


Question 185:

I can't find the answer to this question:

What two factors control the maximum size of a single segment?

I believe that it's the virtual memory size but I can't think of the other factor! Thanks.

Answer 185:

Because segments are either entirely in memory or on disk (segment-file), you can't have a segment larger than the amount of memory you've got (and in theory bigger than the amount of disk you've got, but most people have more disk than RAM, so ..). The second reason is more subtle, hint: look at the structure of a segment-table entry (STE).

Keywords: memory-management


Question 186:

For those of us that don't understand assembly, would it be possible to give an explanation of how both implementations of spinlocks, in the slides, work?

Answer 186:

This is not examinable as such, but here are commented versions anyhow:

    .data                            ; put in initialised data section
    slock:
        .long   0                    ; "slock" is a word of memory

    .text                            ; put in code section
    ; lock routine
    do_lock:
        movl    $1, %eax             ; put constant 1 in EAX register
        xchgl   %eax, slock          ; atomic swap EAX with contents of "slock"
        orl     %eax, %eax           ; bitwise-or EAX with itself, sets condition codes
        jnz     do_lock              ; if EAX is non-zero (i.e. "slock" was previously non-zero)
                                     ; then loop and try again

    ; a better lock routine
    better_do_lock:
        lock,   btsl    0, slock     ; atmoic 'bit test and set' bit 0 in "slock"
        jnc     2f                   ; if carry flag not set (bit previously 0), jump
    1:
        testb   1, slock             ; test byte at "slock" equal to 1
        jne     1b                   ; jump if equal to 1  (testb sets flag backwards)
        jmp     better_do_lock       ; if "slock" is seen as 0, loop for another go
    2:

    ; unlock routine
    do_unlock:
        movl    $0, slock            ; put constant 1 in "slock"

Keywords: assembly


Question 187:

Regarding Q4(c) from the 2004 paper. Since backup is ruled out I was thinking maybe archiving old data since it would be safer off the system which should preferably have only frequently accessed files on the system. Am I thinking correctly in this assumption?

Or is writing the track bitmap (superblock) in multiple places more of a issue here like in co501-02 q1 ?

Answer 187:

What you say about archiving is true, i.e. it's a useful way of storing non-frequently used data. But the main reason for archiving (besides backup) is to free up disk space, so it's not really suitable for helping to detect/recover the file-system after system failures.

Writing the superblock (which isn't actually a track bitmap as such, it's typically a block with file-system specific settings, e.g. the location of any bitmaps, etc.) multiple times is sort of what the question's asking for, but consider how that would (or wouldn't) help here. Writing the maps multiple times might help, but that's more to guard against disk failure.

To ensure reliability/integrity after a system failure, you need to consider what state things could be left in if the system failed mid-way through an update on the file-maps, etc. And what, in the design, could be done to help achieve this. Multiple file-maps might help, e.g. you'd see that some are different (possibly), but how would you know which ones were right ..?

An increasingly common technique is to use a file-system "journal" (or log), but you'd need to talk this through a bit for 7 marks, and probably mention some other things. E.g. how does a journal help to ensure reliability/integrity ? or how can you tell 'good' file-maps from 'bad' file-maps ?

Keywords: exams


Question 188:

Is the content of the last two lectures, i.e. the Case studies, examinable? i mean will there be any questions on those topics in exams??

Answer 188:

The material is there to help explain how the rest of the course fits in with real systems. You are not expected to know every last detail, but the general knowledge might help you in an answer or two.

Referrers: Question 217 (2006) , Question 196 (2004)


Question 189:

Are the case studies (UNIX and VMS) for filing systems important from exam's point of view or it would be sufficient to just learn about the filing systems in general without going into specific filing systems of unix or vms?

Answer 189:

The case studies are there to help you understand the material. You are expected to have a reasonable understanding of theem, but you don't need to know every last detail.

The same applies to the knowledge you have (hopefully) gained about NTFS by doing assessment 4.

Referrers: Question 217 (2006) , Question 196 (2004)


Question 190:

For question 1a 2003, about factors that affect the performance of the disk sub system, would it be valid to talk about things like the disk scheduling algoritm used (FCFS, SSTF etc), the size of the logical block on the disk, fragmentation...etc? This see ms to be quite a broad question...

Answer 190:

Exactly. Also disk caches, etc. You don't need to say everything to get good marks.


Question 191:

On question 3a (2003 paper), "give an example of resource deadlock between two processes", do you want a specific "real life" example or will a general one be enough ? For example, I put: "Process A holds resource Y, but requires the use of resource Z in order to complete and release Y. Process B holds resource Z, but requires the use of resource Y in order to complete and release resource Z. Each process is waiting for the other process to complete. As such, they are deadlocked". Is this OK?

Answer 191:

Yes, that looks OK to me. The example given in the lecture was of the two cooks, so you could use that equally well.

Keywords: exams


Question 192:

The rubric has changed for this year? What will Q1 be based on (i.e. Bob's or Freds material) and has the style of Questions changed?

Answer 192:

Question 1 is worth 40 marks and has five parts. All parts are compulsory and each is worth 8 marks. I think it would be fair to say that these are relatively 'easy' marks, and detailed answers are not generally required. Roughly half of these parts will be from Fred, and the rest from Bob.

Questions 2 to 5 are each worth 20 marks, and you have to answer two of them; any two. They are the same style as in previous years. Two questions from Bob, and two from Fred.


Question 193:

Could you give us a run down of what topic / areas we should know ? Thanks.

Answer 193:

Anything presented in the lectures is examinable. A mostly complete list of topics can be found on the lecture notes page. Going through the material and making a list of different topics is something that you should probably be doing as part of your revision, however.

Keywords: exams


Question 194:

I have been reading the slides and nothing is going in. Any last minute advice ?

Answer 194:

Probably not terribly useful now, but don't leave revision so late! Anxiety probably does little to help concentration and memory.. Instead of just reading, read and make notes (that worked for me, anyway).

Keywords: exams


Question 195:

What is (free) memory consolidation?

Answer 195:

Consolidation: "The act or process of consolidating, making firm, or uniting; the state of being consolidated; solidification; combination.". In the context of memory management, the act of moving things around in memory so that all free memory occurs as a single chunk (instead of being fragmented).

Keywords: memory-management


Question 196:

Do we need to revise all the case studies in the lecture notes for the exams ?

Answer 196:

See the answers to Question 188 (2004) and Question 189 (2004).

Keywords: exams


Question 197:

What are the different kinds of resource, from lecture 15 ? Is the correct answer: processor time, memory, space on storage media, peripherals.

Answer 197:

Essentially yes, but these questions are intended to make you think a bit, rather than just regurgitating the slides.

Keywords: exams


Question 198:

How exactly do characteristics differ from features. Surely resilience is a desirable characteristic and not a feature, where as long term storage would be a feature and not a characteristic.

Answer 198:

See the answer to Question 161 (2004).

Keywords: exams


Question 199:

I am slightly anxious about the exam tomorrow, any last minute advice ?

Answer 199:

Not really, besides the usual exam things (be calm, long deep breaths, look over your revision notes beforehand, etc.).

Keywords: exams

Valid CSS!

Valid XHTML 1.0!

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