Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Greetings, i figure how the first 2 questions but questions 3 and 4 have me gues

ID: 3782921 • Letter: G

Question

Greetings, i figure how the first 2 questions but questions 3 and 4 have me guessing especially number 4. Thank you.

Modify the 'myexp.exp' file to have 5 run lines that will use the following algorithms: FCFS, SJF, RR 1, RR 5, and RR 10. On each run line, make sure that both the algorithm and key are correctly identify each other.

Now modify the 'myrun.run' file so that there will be a total of 20 processes with the following properties:

All processes arrive at time 0.0

All processes have a constant duration of 100

All have constant I/O bursts of 10

All have basepriority 1.0

The first set of 10 processes have CPU bursts uniformly distributed between 2 and 8

The last set of 10 processes have CPU bursts uniformly distributed between 30 and 40

Do not change the seed line of the run file as this will change the sample space.

Example of 'myexp.exp':

name myexp comment This experiment contains 5 runs

run myrun algorithm FCFS key "FCFS"

run myrun algorithm SJF key "SJF"

run myrun algorithm RR 1 key "RR 1"

run myrun algorithm RR 5 key "RR 5"

run myrun algorithm RR 10 key "RR 10"

Example of 'myrun.run': name myrun

comment This contains two types of processes

algorithm SJF seed 5000 numprocs 10 firstarrival 0.0 interarrival constant 0.0 duration constant 100.0 cpuburst uniform 2.0 8.0 ioburst constant 10.0 basepriority 1.0 numprocs 10 firstarrival 0.0 interarrival constant 0.0 duration constant 100.0 cpuburst uniform 30.0 40.0 ioburst constant 10.0 basepriority 1.0

3.Now let us analyze the results. SJF will have the best average waiting time. This is easily identifiable by graphing the Waiting. Why is this behavior evident with our chosen example?

4.Next, compare the trend in the Round Robin experiments as the quantum increases. For large values of the quantum which algorithm will Round Robin mimic and how large does the quantum need to be for our example?

Explanation / Answer

3.) SJF- Shortest Job First algoithm executes the jobs with less burst time first .

It is the optimal algorithm ; it gives minimum average waiting time for a given set of processes becuase by moving a short process before a long one, the waiting time of short process decreases and the algorithm increases waiting time of the long process, so avg. waiting time decreases.

This is because wait time is calculated by C.T.- A.T.=B.T.+ W.T.(Completion time+ Waiting time = Burst time+ Arrival time)

For lesser burst time, if we keep completion time less , the wait time would be low.

While for the processes with higher burst time, higher completion time can also work so this overall produces a lesser average waiting time

4.)

The performance of Round Robin Scheduling depends on the size of time quantum. If the quantum value is too large, it behaves as if it is a FCFS scheduling algorithm. If the time quantum value is too low, context switchcs are too frequent causing additional burden of workload on the CPU. .

If both the quantum size and the context-switch overhead are close to zero, then RR is called processor sharing because it appears to the processes that they each have its own CPU. All ready processes have equal share of CPU time.

For Round Robin to behave as FCFS, the time quantum should equal to the maximum of Burst time among all the processes.

e.g. say there are three processes: P1, P2, P3 with burst time 3,4,7 respectively then any time quantum above 7ms would make round robin behave as FCFS