Problem #1 You are running an application in which five processes are started ne
ID: 3891202 • Letter: P
Question
Problem #1 You are running an application in which five processes are started nearly simultaneously, i.e., assume their arrival time 0 Their estimated time to execute (i.e., their needed CPU time/cycle) are as follows: P2 11 ms P3 16 ms P4 6 ms Part A Answer the four questions below for FCFS (First-In-First-Out Scheduling) 1. 2. 3. In what order do the processes run? What is the total time required for all processes? What is the average turnaround time for the five processes? (Add the total time required for each process and divide by the number of processes.) Show the process runs and timings with a Gantt chart. 4. Part B Now answer the same set of questions for SJF (SPF) (Shortest-Job-First) Scheduling. Part C How do the scheduling algorithms compare in performance for this particular case? Problem #2 An application is running with a multiple level queue and a variable time quantum per queue. The current incoming job needs 80 ms to run to completion. If the first queue has a time quantum of 5 ms and each queue thereafter has a time quantum that is twice as large as the previous one, how many times will the job be interrupted and on which queue will it finish its execution? Show your work with some type of timeline (Gantt chart, table, etc.). It should show the amount of time in ms spent in each queue. Problem #3 An application is running with SJN (Shortest-Job-Next) processing. Seven processes enter the system at the arrival times listed below and with the corresponding CPU burst cycle allocated to each. Indicate the order in which the jobs run to completion. Include a visual timeline (e.g., Gantt chart, some type of table) indicating arrival and completion times. Process ID Arrival Time CPU Burst Cycle 12Explanation / Answer
Part A: FCFS
1. Order of processes ------- P1,P2,P3,P4,P5
2. Total time required for all processes ------- (3+11+16+6+2) = 38ms
3. Average turn around time = 38/5 = 7.6 ms
4. Gantt Chart
0--------------------3---------------------14-------------------30---------------------36------------------38
Part B: Shortest Job First(SJF)
1. Order of processes ------- P5,P1,P4,P2,P3
2. Total time required for all processes = 38ms
3. Average turn around time = 38/5 = 7.6 ms
4. Gantt Chart
0--------------------2---------------------5-------------------11---------------------22------------------38
Part C
The turnaround time is same for both FCFS and SJF algorithms. But the response time is smaller in case of SJF as compared to FCFS.
Problem #2
Process time = 80ms
queue1 = 5ms
queue2 = 10ms
queue3 = 20ms
queue4 = 40ms
queue5 = 80ms
The job will be interrupted 4 times.
The process will finish its execution in 5 queues.
Problem #3 Shortest Job Next
0------------3-----------4-------------5--------------8------------10-----------15-----------23----------35
Do ask if any doubt, Please upvote.
P1 P2 P3 P4 P5Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.