Discuss thoroughly An application program in wide use contains a… Discuss thoroughly An application program in wide use contains a set of
Discuss thoroughly An application program in wide use contains a… Discuss thoroughly An application program in wide use contains a set of printable strings which areerror messages and other helpful messages to the user. The program prints aselection of these messages each time it is run. Describe the route these messageshave typically taken from the point where the programmer textually enters them,to the time they are displayed by the running application on an output device. What is a data cache and how does it differ from an instruction cache?[4 marks](b) What statistical properties of memory access do caches exploit to deliverimproved performance? [4 marks](c) What impact will an operating-system-managed context switch have on cachehit rate? Justify your answer. [4 marks](d) Modern desktop and server processors support simultaneous multithreading(also called hyperthreading). When will there be a performance benefit inscheduling two non-interactive applications on the same hyperthreaded processorcore so that they run in parallel rather than running sequentially, one job oneafter the other? [4 marks](e) For level-1 data caches using a snoopy cache coherency protocol, is a write-backor a write-through policy more likely to be used?(a) What is the difference between routing and forwarding? [2 marks](b) Routing algorithms can be either link-state or distance-vector. Define these twoterms and explain the trade-offs between them. [6 marks](c) You are required to design a topology discovery protocol for a network ofswitching nodes interconnected by links. There are n nodes, l links, themaximum degree of any node is k and there is a path between any two nodes ofnot more than d hops. All links are bi-directional.Each node has a unique identifier of four bytes which it knows.(i) Describe a protocol for a node to learn about its immediate neighbours.You should specify the format of your messages and the size of any messagefields. [4 marks](ii) Using the characteristics of the network described above, design a protocolfor distributing this information across the network. You should specifythe format of your messages and the size of any message fields.Personal computers and workstations contain monitor and boot programs in nonvolatile memory. Explain the functions that the code in this memory can provide,including the facilities that could be available at the following times:(a) power-on reset;(b) system self test;(c) kernel boot; Consider an unreliable message service where messages of a fixed size are sentbetween known endpoints. Outline the minimum set of additional featuresoffered by a reliable byte-stream delivery service. [3 marks](b) A researcher notes that the message service, fritter, resembles a datagramservice. It is prone to delivery delays of up to 1 second, message re-orderingand message loss. Fritter permits a 140-byte message to be relayed between anytwo users and each message is delivered without data-corruption.You are asked to implement a Stop-and-wait ARQ to provide a unidirectionalreliable byte-stream delivery service between two fritter users. Assume this isthe only service between the two fritter users.(i) Provide a labelled diagram illustrating the format for a fritter messagethat could be used by a reliable, byte-stream, delivery service. Justify youranswer. [3 marks](ii) Draw and label the Finite State Machine that implements the senderportion of the Stop-and-wait ARQ. Your function will be called asreliable send() while the fritter message receive and message send functionsare fritter rcv() and fritter send() respectively. You may assume that theargument to the reliable send() function does not exceed 100 bytes perfunction call. [8 marks](iii) Users assert that the performance using your Stop-and-wait ARQ is terriblefor large transfers. Explain why they are correct. [2 marks](iv) Describe an appropriate enhancement to the ARQ that will improveperformance. Given the constraints of a small fritter message size,justify why your particular ARQ enhancement is best suited to the fritterapplication. [4 marks]8CST.2014.5.97 Concurrent and Distributed SystemsCorrect handling of time is critical to the correctness (and performance) of distributedsystems such as network file systems and databases. Consider the following twoapproaches.(a) Physical clock synchronisation(i) Define clock skew and clock drift. [2 marks](ii) A client running Cristian’s Algorithm observes a local clock time of1399157100.00s at the start of its RPC, and 1399157100.10s at the endof its RPC. The RPC returns a server timestamp of 1399157100.05s. Whatclient-server clock skew will the algorithm calculate? Justify your answer.[2 marks](b) Distributed logical clocksThe make build tool relies on file-system timestamps to determine whether anobject file is older than a source file: if so, the object file is rebuilt; if not, thena rebuild is avoided. However, it is common practice to store source code ina distributed file system and object files in a local temporary directory. TheNetwork File System (NFS) stores file creation and modification times based onthe server clock, whereas the local file system uses a local clock.(i) Describe the two failure modes make may experience if client and serverclocks are out of sync. [2 marks](ii) One solution is to use NTP to synchronise client and server clocks. Describetwo reasons why this might work poorly in practice. [2 marks](iii) The NFS developers decide that Lamport Clocks may be able to solve theproblem, as they track the happens-before relationship. During a particularrun, make finds a source logical timestamp s is less than the object logicaltimestamp o. Explain why it is problematic to use Lamport Clocks toconclude that the object file should not be recompiled. [4 marks](iv) Explain why Vector Clocks might be more suitable than Lamport Clocksfor this problem. [2 marks](v) Explain what a Vector-Clock-based make should do if there is no definedhappens-before relationship between source vector s and object vector o.[4 marks]9 (TURN OVER)CST.2014.5.108 Concurrent and Distributed Systems(a) Monitors are a programming primitive linking data with two synchronizationtypes: mutual exclusion and condition synchronisation. Which is providedimplicitly; which is provided explicitly? [1 mark](b) Describe two ways in which Monitors and Conditional Critical Regions differ.[2 marks](c) The object-oriented programming style encouraged by Monitors has manybenefits as the number of data types and locks increases in the system.(i) Placing all data in a single Monitor may improve program correctness.Explain why this might have undesirable performance effects. [1 mark](ii) One problem that can arise when using multiple locks is deadlock, which canbe prevented by imposing a partial order on locks. Describe the implicationsthis has for code structure when using Monitors. [2 marks](iii) Explain why Java’s Monitor feature does not necessarily impose this codestructure. [2 marks](d) Condition variables allow condition satisfaction to be signalled between threads.Explain the difference between Hoare’s signal-and-wait and Mesa’s signal-andcontinue in terms of mutual exclusion and scheduling For a transaction model based on objects:(a) Define how conflict may be specified in terms of object operation semantics.Give an example of conflicting operations. Give an example of non-conflictingoperations that would conflict with read-write semantics. [3 marks](b) Define the necessary and sufficient condition for two transactions to beserializable. Give an example of a non-serializable pair of transactions.(c) Define the necessary and sufficient condition for a concurrent executionschedule of a number of transactions to be serializable. Give an example of aserialization graph for four transactions that are non-serializable. [2 marks](d) Discuss how the three general approaches to providing concurrency controlfor transaction systems are designed to enforce the property you have definedin (c) above. 1 Write program that prints your full name.. Write program that prints your full name using asterisk(*).Write program that prints a square, a rectangle and a triangle using asterisk. 4 A Modula-3 library module is required to provide a buffered stream of charactersbetween two threads, with appropriate synchronization.Write a Buffer interface defining an opaque object type, T, with the followingmethods:init: taking an argument specifying the buffer size and returning a suitablyinitialized objectput: inserting a single character into the bufferget: extracting a single character from the buffer[4 marks]Sketch a corresponding implementation giving(a) the concrete revelation of the types [4 marks](b) the three default methods [4 marks each].2CST.96.3.33 Continuous MathematicsWe compute the representation of some continuous function f(t) in a space spannedby an orthonormal family {?j (t)} of continuous basis functions by projectingf(t) onto them. We express these projections in bracket notation


