Question: Question 3: CPU Scheduling (25 points) a) Which of the following scheduling algorithms are subject to process starvation? Explain your answers in each case (6



Question 3: CPU Scheduling (25 points) a) Which of the following scheduling algorithms are subject to process starvation? Explain your answers in each case (6 marks). i). First Come, First Served. ii). Shortest Job Next iii) Round Robin b) Consider the following set of processes, with the length of the CPU-burst time given in milliseconds Process Burst Time Priority P1 8 3 P2 1 1 2 3 1 4 P5 5 2 P3 P4 The processes are assumed to have arrived in the order P1, P2, P3, P4, Ps, all at time 0. i). Draw Gantt charts illustrating the execution of these processes using a non- preemptive priority (a smaller priority number implies a higher priority), and Round Robin (quantum 1) scheduling. (5 marks) ii). What is the average turnaround time of each process for each of the scheduling algorithms in i)? (5 marks) 1.0 c) Suppose that the same processes arrive for execution at the times indicated below but with the same burst time as given in b) above. Process Arrival time P1 0.0 P2 0.5 P3 1.5 Ps 2.0 Draw Gantt charts illustrating the execution of these processes using FCFS and Shortest Job First non-preemptive scheduling. (4 marks) ii). Which of the schedules in i) results in the minimal average waiting time (over all processes)? (5 marks) P4 b) Consider a system consisting of four resources of the same type that are shared by three processes, each of which needs at most two resources. Show that the system is c) Consider the following snapshot of a system consisting of five processes P, through Question 4: Deadlock (25 points) a) What are the necessary conditions for a deadlock? (4 marks) deadlock free. (5 marks) Ps; three resource types A(9 instances). Bla instances) and C(8 instances) Process Allocation Request Available ABC ABC ABC P1 0 20 000 000 P2 3 00 3 02 P3 4 03 000 P4 2 22 1 00 003 003 Answer the following questions using modified banker's algorithm : i. Show that the system is not in a deadlock state and find a sequence for executing the processes (8 marks) ii. If process Ps makes one additional request for an instance of type A, show the content of the Request matrix and determine the state of the system. (8 marks) P5 Question 5: Memory Management (25 points) a) What are the three major activities of an operating system in regard to memory management? (4.5 marks) b) Differentiate between : i. Internal and external fragmentation. (3 marks) First-fit, Next-fit and Best-fit memory allocation techniques (6 marks) iii. Release-match and Age-match memory allocation technique (3 marks) c) Given memory partitions 100KB, 500KB, 200KB, 300KB, and 600KB (in order), show how First-fit, Next-fit and Best-fit memory allocation techniques place processes of 212KB, 417KB, 112KB, and 426KB (in order). Which algorithm makes the most efficient use of memory? (8.5 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
