Rate monotonic (RM) and earliest deadline first (EDF) are two…

QuestionAnswered step-by-stepRate monotonic (RM) and earliest deadline first (EDF) are two…Rate monotonic (RM) and earliest deadline first (EDF) are two popular scheduling algorithms for real-time systems. Describe these algorithms, illustrating your answer by showing how each of them would schedule the following task set. Task Requires Exactly Every A 2ms 10ms B 1ms 4ms C 1ms 5ms You may assume that context switches are instantaneous. Which of these is harder to implement using the standard Unix access control mechanisms, and why? [10 marks] Sketch an implementation of the easier policy using Unix mechanisms. [5 marks] Describe at least two alternative mechanisms that might be used to implement the other policy. [5 marks] 5 Data Structures and Algorithms Describe an efficient algorithm based on Quicksort that will find the element of a set that would be at position k if the elements were sorted. [6 marks] Describe another algorithm that will find the same element, but with a guaranteed worst case time of O(n).(a) What is microcode and how does it differ from assembler? [6 marks] (b) In assembler, branch instructions are used to change the flow of control. How can flow control be determined in a microcode environment? [4 marks] (c) With the aid of a diagram, explain what a feedback path (sometimes called a bypass) is and how it is used to improve the throughput of a pipeline. [6 marks] (d) What is a branch delay slot? [4 marks] 2 CST.2002.6.3 3 Digital Communication I Define a resource in a digital communication system as anything whose use by one instance of communication prevents simultaneous use by another. Channel capacity is one example. (a) Give two more examples of resource in digital communication systems. [4 marks] (b) For the three resources, indicate how the amount of total resource can be increased. [6 marks] (c) How are allocations of each of these resources to instances of communication performed? [10 marks] 4 Concurrent Systems and Applications A system is to support abortable transactions that operate on a data structure held only in mtrict two-phase locking (S-2PL) and how it enforces strict isolation. [4 marks] (c) What impact would changing from S-2PL to ordinary 2PL have (i) during a transaction’s execution, (ii) when a transaction attempts to commit and (iii) when a transaction aborts? [6 marks] (d) You discover that the system does not perform as well as intended using S-2PL (measured in terms of the mean number of transactions that commit each second). Suggest why this may be in the following situations and describe an enhancement or alternative mechanism for concurrency control for each: (i) The workload generates frequent contention for locks. The commit rate sometimes drops to (and then remains at) zero. [2 marks] (ii) Some transactions update several objects, then perform private computation for a long period of time before making one final update. [2 marks] (iii) Contention is extremely rare. [4 marks] 3 [TURN OVER CST.2002.6.4 SECTION B 5 Comparative Programming Languages (a) Briefly discuss the compromises that must be made when standardising a programming language. [8 marks] (b) Discuss the relative merits to (1) the application programmers and (2) compiler writer of the following ways of specifying a programming language. (i) A concise readable user manual for the language in English containing many useful programming examples. (ii) A very long and highly detailed description, in English, of every feature of the language. This manual contains no programming examples. (iii) A concise but rigorous description using a formal grammar to describe the language syntax and making extensive use of mathematical notations taken from set theory, ?-calculus, predicate calculus and logic to describe the semantics of the language. (iv) The source code for a clean and elegant machine-independent interpretive implementation of the language. public void add(){     ArrayList students = new ArrayList();           System.out.println(“Enter First name:”);        String firstName = sc.next();        System.out.println(“Enter Last name:”);        String lastName = sc.next();        System.out.println(“Enter Student ID:”);        long studentID = sc.nextLong();          System.out.println(“Enter date of birth (dd):”);        int dd = sc.nextInt();        System.out.println(“Enter month of birth (mm):”);        int mm = sc.nextInt();        System.out.println(“Enter year of birth (yyyy):”);        int yyyy = sc.nextInt();         while(true){           System.out.println(“Enter U for undergrate Student or G for Graduate Student:”);           String addAnswer = sc.next().toLowerCase();             if(addAnswer.equalsIgnoreCase(“u”)){              System.out.println(“Enter Assignment 1 mark”);              int assignment1 = sc.nextInt();              System.out.println(“Enter Assignment 2 mark”);              int assignment2 = sc.nextInt();              System.out.println(“Enter Practical Work mark”);              int practicalWork = sc.nextInt();              System.out.println(“Enter Final Examination mark”);              int finalExam = sc.nextInt();               break;          }                 else if(addAnswer.equalsIgnoreCase(“G”)){                   System.out.println(“Enter Enrollment Type:”);              String enrollmentType = sc.next();              System.out.println(“Enter Number of year completed:”);               int yearCompleted = sc.nextInt();               System.out.println(“Enter final grade:”);               char finalGrade = sc.next().charAt(0);                            break;          }                 else{              System.out.println(“Wrong Input”);          }     }        String outfileName =”Student.csv”;     PrintWriter writer = null;     try{         writer = new PrintWriter(outfileName);        for(int i =0; iinitLoc)return “nMove “+icon+” right” + solveColumn(++initLoc, finLoc, icon); elsereturn “nMove “+icon+” left” + solveColumn(–initLoc, finLoc, icon);} public static void main(String[] args) throws FileNotFoundException{//initialize componentsScanner scan=new Scanner(System.in);ArrayList input=new ArrayList(); //holder of string lines from the fileArrayList chars=new ArrayList(); // holder of each characters from the fileboolean isOK=false; //checker if the file is validint boardSize=0; // board size holderFile file=new File(“”); // file holder;  while(!isOK){System.out.println(“Enter file name: “); // ask the user to input file name, should be in root folderString fileName=scan.nextLine(); file=new File(fileName);Scanner fileScan=new Scanner(file);while(fileScan.hasNext()){String tmp = fileScan.nextLine();input.add(tmp); //add each line to input array String[] tmpSplit=tmp.split(“”);//add each character to chars arrayfor(String a:tmpSplit)chars.add(a); }fileScan.close();boardSize=Integer.parseInt(input.remove(0)); //set the first element of input array as the boardsize and removes itchars.remove(Integer.toString(boardSize)); // remove board size character from chars array //check of boardsize matches the number of rows each board has, output a message if notif(boardSize != (input.size())/2){System.out.println(“Board Size not match”);}isOK=(boardSize != (input.size()-1)/2);}//initialize the two boardsString[][] initialBoard=new String[boardSize][boardSize];String[][] targetBoard=new String[boardSize][boardSize]; //set initial boardfor(int i=0; i toSolve=new ArrayList()for(String a:chars){if(!toSolve.contains(a))toSolve.add(a);} Collections.sort(toSolve); // sort toSolve array ArrayList initIcons=new ArrayList(); // create rray instance of initial board using Icon objectArrayList finalIcons=new ArrayList();// create an array instance of target board using Icon object //set valuesfor(int i=0; i