Question: Please answer ALL parts ( a through i ). If all parts are answered completely, you'll get a thumbs up! !! Problem 3: Operating Systems
Please answer ALL parts (a through i). If all parts are answered completely, you'll get a thumbs up!!!

Problem 3: Operating Systems 4.5 points] Consider this table when answering the following questions about scheduling. The table shows a list of processes P1 through P5. For each process, the total running time is given in the table. For example, if process P3 was given the CPU at time t, and was allowed to run to completion without being interrupted, it would finish at time t12) Process P1 P2 P3 P4 PS Total Running Time 26 12 6 18 A schedule for tasks can be shown as a chart. For instance, if processes P2, P4, P3 arrive in that order and the OS processes them using a first come, first served schedule, the schedule of tasks would be as follows Process running on CPU Time 0 1 2 3 4 56 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Note that in the above schedule, process P2 does not have to wait. It gets the CPU immediately ie at time-0). Process P4 has to wait for 3 units of time (while process P2 finishes) and process P3 has to wait 9 units of time (while P2 and P4 finish). (a) Suppose the processes arrive in the order P1, P2, P3, P4, P5. Draw a chart for this schedule of tasks assuming first come, first served processing. (b) Find the wait time for each process in (a) and the average waiting time for the 5 processes according to the schedule in (a) (c) What order should the 5 processes arrive in if the result of first come, first served is to minimize the overall average wait time? (d) Give the schedule of tasks in chart form corresponding to (c). (e) What is the average wait time corresponding to (c)? (f) Recall that with round robin scheduling, each process is given a small unit of CPU time (time quantum), q. After this has elapsed, the process is removed from the CPU (even though it has not finished executing) and added to the end of the queue Suppose the processes are initially ordered in the queue as P1, P2, P3, P4, P5 and let q 6. Give the chart for this schedule. Find the wait time for each process and the average wait time. (g) Suppose that there are n processes in the queue and the time quantum is q Describe in terms of n and q) the maximum number of time units a process will wait to use the CPU for the first time. Hint: each process receives at most -of the CPU time in chunks of at most q time units. (h) What are the advantages of a short quantum? What are the disadvantages? (i) What is the purpose of system calls? Why are they necessary
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
