# Operating System - Process Scheduling

6:

Consider a set of 5 processes whose arrival time. CPU time needed and the priority are given below

 Process Priority Arrival Time (in ms) CPU Time Needed (in ms) Priority P1 0 10 5 P2 0 5 2 P3 2 3 1 P4 5 20 4 P5 10 2 3

smaller the number, higher the priority.

If the CPU scheduling policy is SJF with pre-emption, the average waiting time will be

 A. 8 ms B. 14 ms C. 5.6 ms D. none of these Answer Report Discuss Option: C Explanation : Scheduling order will be P2    ,     P3    , P1     ,  P5    , P1,  P4 Waiting time of processes will be P2 = 0 P3= 5-2=3 P1=10+2=12 P5=0 P4= 10 Average waiting time will be  = (0+3+12+0+10)/5= 23/5=4.6ms   Click on Discuss to view users comments. Write your comments here:
7:

Consider a set of 5 processes whose arrival time. CPU time needed and the priority are given below

 Process Priority Arrival Time (in ms) CPU Time Needed (in ms) Priority P1 0 10 5 P2 0 5 2 P3 2 3 1 P4 5 20 4 P5 10 2 3

smaller the number, higher the priority.

If the CPU scheduling policy is priority scheduling without pre-emption, the average waiting time will be

 A. 12.8 ms B. 11.8 ms C. 10.8 ms D. none of these Answer Report Discuss Option: C Explanation : 30 + 0 + 3 + 3 + 18 divided by 5, i.e. 10.8 ms. Click on Discuss to view users comments. Rnns said: (11:03am on Monday 30th October 2017) Its 11.8 sec because it is non preemptive... So once process is started then it will complete before starting another process... Waiting time of p1 to p5 it is 37, 0, 3, 2, 17.. Total= 59, average= 59/5 = 11.8 Write your comments here:
8:

Consider a set of 5 processes whose arrival time. CPU time needed and the priority are given below

 Process Priority Arrival Time (in ms) CPU Time Needed (in ms) Priority P1 0 10 5 P2 0 5 2 P3 2 3 1 P4 5 20 4 P5 10 2 3

smaller the number, higher the priority.

If the CPU scheduling policy is priority sche duling with pre-emption, the average waiting time will be

 A. 19 ms B. 7.6 ms C. 6.8 ms D. none of these Answer Report Discuss Option: B Explanation : Here the process which will start at the initial millisecond will be P2 as it has more priority that P1. ms          Process 0 to 2       P2 (P2 completed 2 ms here) 2 to 5        P3  (No wait for P3) 5 to 8      P2  (P2 had to wait 3 ms to get executed ) 8 to 10       P4 (P4 had to wait 3 ms to get started) 10 to 12     P5 (No wait for P5) 12 to 30    P4 (P4 had to wait 2 ms to complete its remaining) 30 to 40   P1 (Was waiting for 30 ms) So, waiting time----         P1 -30 P2 -3 P3 -0 P4 -5 P5 -0 Average----                        (30+3+0+5+0)/5= 7.6 ms . Click on Discuss to view users comments. Write your comments here:
9:

Cascading termination refers to termination of all child processes before the parent terminates

 A. normally B. abnormally C. normally or abnormally D. none of these Answer Report Discuss Option: C Explanation : Click on Discuss to view users comments. Write your comments here:

## Suggest an improvement

Syllabus covered in this section is-

• Main functions of operating systems
• Memory Management- Virtual memory, paging, fragmentation
• Concurrent Processing: Mutual exclusion, Critical regions, locks and unlock.
• Scheduling: CPU scheduling. I/O scheduling, Resource scheduling
• Banker's algorithm for deadlock handling.

This Section covers Operating System Questions Answers .These questions can be used for the preparation of various competitive and academic exams like

• UGC NET Computer Science
• Pre PhD Entrance Exam
• DOEACC Exams
• Kendriya Vidyalaya Sangathan Entrance Exam
• GATE Computer Science
• Post Graduate Computer Science Test
•  PhD Entrance Exam
• Computer Engineering
• State Eligibility Test (SET)
• National Eligibility Test (NET)

Who can benefit

• Operating System Objective Questions Answers can be used by any student who is preparing for PhD entrance exam, pre PhD entrance exam, entrance exam or any other such exam.
• Any student who is preparing for DOEACC exams can also use Operating System questions answers for preparation of his exams.
• Operating System mcq can be useful for the students who are pursuing any undergraduate or post graduate degree in computer science like BE, ME , Btech, Mtech, .BSc, MSc, BCA, MCA, BS, MS  or any other such degree
• Operating System mcq with answers and explanation can also be useful for the students who are preparing for any competitive exam or recruitment exams like GATE Computer Science, UGC NET Computer Science, Kendriya Vidyalaya Sangathan PGT exam, PSU, IES or any other such exam.
• Operating System multiple choice questions answers  can also be used by any candidate who wants to gain credits in Operating System in BS Computer science or MS Computer science,