Tentamen vid Institutionen för Datavetenskap, Linköpings universitet TENTAMEN TDDB47 Realtidssystem DATUM: 15 December 2004 TID: 14-18 PLATS: TER1 ANSVARIG JOURLÄRARE: Examinator Simin Nadjm- Tehrani (Tel: 0702 282412) Material: English-Swedish-English dictionary Calculator No of assignments: 5 Total no. of points: 40 Preliminary grade limits for grades: 3, 4 and 5 3: 20 - 25 p 4: 26 - 33 p 5: 34 - 40 p INSTRUCTIONS: Please write your name, class and personal number (sv. personnummer) on each sheet of paper that you hand in. Further, pages should only contain one answer per page (answers to sub-questions can be on the same page). You are asked to only write on one side of each paper. Please sort all the sheets that you hand in, in the order of the question number. Make sure your answers are supported by clear explanations. Figures or charts can be used to provide a clearer explanation but should be accompanied by a textual description. Points will not be given to answers for which the reasoning cannot be followed or that cannot be read due to bad handwriting. You may answer in Swedish or English as you prefer. Hints: Try to dispose of your time on each question in proportion of the assignment points. In any case where you are in doubt about the question, write down your interpretation and assumptions, and answer the question based on the interpretation. A correct answer that is embedded in errors may give reduction in points, so make sure your answers are to the point. Results are reported no later than January 7th . Good luck! Simin Nadjm-Tehrani Tentamen vid Institutionen för Datavetenskap, Linköpings universitet Q1: Scheduling a) Assume that the following task set is to be analyzed for its real-time properties in a new generation of the Mars Rover: (1) the trajectory following task for finding the way to a well-defined physical coordinate, (2) the sensor & measurement task that configures and reads various sensor’s values, (3) a disk storage task that is responsible for periodically writing the buffered measured values on a log on persistent memory, (4) a communication task for contacting the ground station and sending cached data. The following table summarises the task set’s periods and worst-case execution times (WCET) in milliseconds. Task Trajectory follower Sensor & measurement Disk storage Ground communication Period 1500 500 3000 500 WCET 100 100 1000 200 1) Assume that the tasks can be scheduled as independent tasks. Assume further that the task set should be scheduled using a cyclic executive for which the overhead can be considered as negligible. How could such a cyclic schedule be constructed? In particular what is the minor and major cycles for the schedule? (2 points) 2) Assume that to lower the processor utilization the communication overhead is reduced by using a dedicated channel that is used every 500 ms with a 50 ms WCET. Furthermore, the sensor configuration frequency can be reduced to once every second. Assume that the scheduling overhead (including context switches) is now to be included in the analysis at the maximum rate of 10ms per 100ms of CPU time. Explain whether the task set is schedulable with rate-monotonic scheduling (RMS). Include all the assumptions in your analysis. (5 points) 3) In order to make the utilization more effective there is plan to change to a communication bus that may then be shared by both the disk storage task and the ground communication task following the communication pattern (period and WCET) under 2) above. To deal with the conflicts over the bus the immediate ceiling protocol is to be combined with RMS. Find the maximum blocking time of the communication task assuming that the disk storage task’s access to the bus can be bound to 150ms each time it gets access to the bus. Motivate your answer! (2 point) b) In what sense is Earlier Deadline First (EDF) an optimal scheduling algorithm? (1 point) c) Analytical results for schedulability analysis are typically based on restrictions such as fixed task sets, and regular arrival times. What kind of guarantees can be offered in applications in which the set of tasks arriving at the system are not determinable a-priori? (1 point) Tentamen vid Institutionen för Datavetenskap, Linköpings universitet Q2: Dependability Explain the three notions of availability, reliability, and integrity. (3 points) a) b) Take a stand on the following propositions (true or false), and motivate your answer: 1) A program that is reliable cannot lead to failures as it will not contain faults that cannot be detected. 2) Testing real-time systems should cover testing every concurrent process and also the interaction of the processes in the time domain. 3) “Redundancy in time” makes real-time systems fault-tolerant in presence of transient faults. (3 points) c) Explain the relationship between the response time of a service and its availa bility. (2 points) Q3: Design Proving the end-to-end timeliness of a real-time service is difficult since real-time properties are cross-cutting concerns that need modelling and support for analysis at several layers of the design. Consider the analysis of response time with parameters from different layers. For each of the following propositions provide a convincing argument for or against the statement. For an argument to be convincing you should exemplify or give historical evidence for a proposition you agree with, and provide counter-examples against a proposition you disagree with. a) As the programmer’s familiarity with a language reduces the risk of introducing faults in the implementation, it is best to let the developer of a system to freely choose the language (and constructions) used in an implementation. (1 point) b) The software running in a real-time system cannot be analysed with respect to timeliness unless characteristics of the hardware that it will be running on are known. Any future up-grades of this hardware invalidates the earlier analyses, and necessitates a repetition of the analysis. (2 points) c) A real-time system typically includes a set of concurrent tasks. Formal modelling the set of tasks enables discovering the dependencies between the tasks, including the potential for a deadlock. This will ease the analysis of the task set under a particular resource allocation scheme. (3 points) Tentamen vid Institutionen för Datavetenskap, Linköpings universitet Q4: Real-Time Operating Systems a) Explain three main functions of a real-time operating system (RTOS), and give the difference between these functions in an RTOS compared to an ordinary operating system. (6 points) Q5: Distributed systems a) Compare fault models for monolithic systems with fault models in distributed systems and explain which type of distributed system is easiest to make faulttolerant. (4 points) b) Why is it harder to guarantee the end-to-end timeliness of a service in a distributed system? (1 point) c) In a distributed time-triggered architecture (TTA) the communication bus bandwidth is used efficiently as the information about sender, receiver, time stamp and message size need not be transferred for every message exchanged. 1) Can the TTA bus be considered as an implementation of a reliable broadcast? Why or why not? Motivate your answer by referring to the components of the TTA design that enforce the desired properties. (3 points) 2) Does the architecture impose a scheduling scheme for the tasks running locally at each node of the system (event-triggered or time-triggered)? If not, how can the tasks be scheduled locally? (1 point)