Vous êtes sur la page 1sur 5

DEPARTMENT OF COMPUTING SCIENCE & MATHEMATICS

Computing Science Examination Autumn Semester 2010

ITNP17: Concurrent and Distributed Systems

Thursday 16 December 2010

14:00- 16:00 hours

Attempt THREE questions. All questions carry equal marks. The distribution of marks among the parts of each question is indicated

IMPORTANTNOTE It is essential that you write your registration number on the front of each answer book. Also, when you have completed the examination, the number of answer books that you have used must be prominently written on the front of one book.

2 ITNP17 16th December 2010

1.

(a)

Concurrent execution of processes and threads is usually dependent on a scheduler and dispatcher. Explain briefly what they do. At a basic level schedulers are split into preemptive and nonpreemptive schedulers. Explain the difference. Why are operating systems with a preemptive scheduling algorithm more common? [4] Schedulers may employ a number of algorithms to decide in which order processes should run. Common examples are First-come Firstserved, Priority Scheduling, Round Robin, and Shortest Job First. Assume that 5 jobs arrive at the same time. They have estimated running times of 16, 4, 8, 2, 12 ms. Their priorities are 3, 5, 2, 4, 1, respectively, with 5 being the highest priority. Describe each scheduling algorithm briefly, and calculate the average waiting time for the set of processes in the example. Ignore process switching overhead and assume all processes are fully CPU bound. The time quantum for the Round Robin algorithm is 4 ms. Which algorithm would you choose and why? [15] Java uses a preemptive priority based scheduling system. If you write a java application with threads of differing priority, what measures might you take in your code to ensure satisfactory operation? Describe the potential problems you need to overcome. [6]

(b)

(c)

Continued/

3 ITNP17 16th December 2010

2.

(a)

In the context of concurrent programs the terms race condition and critical section are often used. Explain briefly what they mean. [4] In Java the Monitor synchronisation mechanism has been implemented. Describe the Java synchronisation mechanism and the use of the main Java methods/keywords. Use diagrams to aid your discussion and provide a simple Java example of a correctly synchronised bounded and blocking buffer (does not need to compile!). [11] The diagram below (a) shows a real-life traffic scenario which could lead to deadlock (if one car from every direction enters the first section of the junction (b)). Using a suitable notation, model the scenario showing the deadlock. How would you prevent the deadlock from occurring here? Describe your solution and using the same notation as before, show deadlock freedom. [10]

(b)

(c)

(a)

(b)

Continued/

4 ITNP17 16th December 2010

3.

(a) (b)

Describe how distributed systems differ from concurrent systems.

[6]

Computer-based navigation systems in aircraft and spacecraft often carry out parallel calculations on separate hosts. Assume a single host is used to average these calculated values. Describe in detail an algorithm that would allow this host to be replaced should it fail. Use diagrams to aid your answer and describe the messages exchanged between the hosts. [14] The approach described in part (b) assumes the goal is to provide a single host to provide the average. Do you think an alternative approach could be used to provide the average? Describe any benefits or drawbacks your alternative approaches may have. Justify any comments you make in your answer. [5]

(c)

Continued/

5 ITNP17 16th December 2010

4.

(a)

Distributed software requires Communication facilities. Describe the difference between two fundamentally distinct approaches that are often used. [5] Enterprise computing implies transparency for the programmer where the invoked components are in practice distributed. Describe in detail a mechanism you have used that attempts to provide this transparency. Ensure you highlight any stages that the programmer must carry out that tend to expose the underlying communication mechanism. [15] Imagine you have written software for a distributed system. How must your code differ from that run on a single computer? [5]

(b)

(c)

END OF EXAMINATION

Vous aimerez peut-être aussi