In: Computer Science
1. What is the average waiting time for Processes If the Operating System uses the Shortest-Job-First (SJF) Scheduling Algorithm?
(P1=5 ms, P2=10 ms, P3=15 ms)
2. How many page faults occur in the Optimum Page Replacement algorithm (OPR) with the following reference string for three-page frames?
Reference String: 4,2,1,3,2,3,4,1
3. What is the average waiting time for Processes If the Operating System uses Shortest-Job-Remaining-First (SJRF) Scheduling Algorithm?
(P1=5 ms, P2=10 ms, P3=15 ms)
Arrival Time ( P1=0 ms, P2=5 ms, P3=10 ms)
4. What is the average waiting time for Processes If Operating System uses the First Come First Serve (FCFS) Scheduling Algorithm?
(P1=5 ms, P2=10 ms, P3=15 ms)
Process Order: P2, P1, P3
5. What is the average waiting time for Processes If the Operating System uses Round Robin (RR) Scheduling Algorithm?
(P1=5 ms, P2=10 ms, P3=15 ms)
Time slice/ quantum = 5 ms
6. What is the average waiting time for Processes If the Operating System uses the Priority Scheduling (PS) Scheduling Algorithm?
(P1=5 ms, P2=10 ms, P3=15 ms)
Priority Order: P3, P1, P2
7. How many page faults occur in the FIFO replacement algorithm with the following reference string for THREE-page frames?
Reference String: 4,2,1,3,2,3,4,1
8. How many page faults occur in the Least Recently Used Algorithm (LRU) with the following reference string for three-page frames?
Reference String: 4,2,1,3,2,3,4,1
SCHEDULING ALGORITHMS:
turn around time : it is interval between arrval time and completion time of the process
turn around time(TAT)=completion time(CT)- arrival time(AT)
waiting time:interval between TAT and burst time(BT) and the time it waits in the ready queue
waiting time:TAT-BT
burst time:time to run a process
arrival time:the time for process to more from new ready to new
Completion time:time to move from to terminate state(see in the gantt chart)
average waiting time(WT)=sum of all processes waiting time/number of process
FCFS(first come first serve):
Selection criteria:arrival time
mode of operation:non preemptive
conflict resolution:lower process id
SJF(shortest job first):
Selection criteria:burst time
mode of operation:non preemptive
conflict resolution:lower process id
SRJF(shortest remaining job first):
Selection criteria:burst time
mode of operation:preemptive
conflict resolution:lower process id
RR(round robin):
preemption of the running process is based on completing of time quantum allocated to a process.
Selection criteria:arrival time+time quantum
mode of operation:preemptive
Priority scheduling:
Selection criteria:priority
mode of operation:non preemptive
conflict resolution:lower process id
PAGE REPLACEMENT ALGORITHMS:
Optimal page replacement algo:
in the event of page fault,victimise that page which will not be used for the largest duration of time in future refrences.
FCFS(First come fisrt serve):
criteria:time of load
LRU(least recently used):
in the event of page fault,victimise that page which was not used recently.