Question 1)

Round Robin Scheduling

There will be non-linear improvement due to reduced overhead of context switching.

 

Question 2)

 

a) If the time quantum will be increased then the I/O utilization on a Round-Robin scheduler will decrease. The rationale behind this is that since I/O-bound processes have shorter CPU burst, thus by increasing the time -quantum, CPU bound processes which have larger burst will occupy the CPU for more time, thus it will decrease the I/O utilization.

b) Yes, the CPU bond jobs will take longer to finish when the time-slice decreases. When the time-slice length decreases, programs with larger CPU burst will have to wait for quite sometime before its again scheduled. Thus the CPU bound jobs will suffer for greater waiting time in case of smaller time slice as compared to large-time slice, where the same jobs could have been finished in fewer quantum's and thus less wait.

Question 4)

 

a)

            Priority Scheduling

                        Processor 1

                                    P1    00-20 ms

                                    P3    21-71 ms

                        Processor 2

                                    P2     10-30 ms

                                    P1      31-40 ms

                                    P4      41-61 ms

                                    P1      62-63 ms

 

            Average Turnaround Time = 155/4 =  38.25 ms

 

 

            Round-Robin

                        Processor 1

                                    P1    00-20 ms

                                    P3    21-71 ms

                        Processor 2

                                    P2     10-30 ms

                                    P1      31-41 ms

                                    P4      42-62 ms

 

Average Turnaround Time = 134/4 =  33.5 ms

 

Shortest-Job-First

                        Processor 1

                                    P1    00-30 ms

                                    P3    31-81 ms

                        Processor 2

                                    P2     10-30 ms

                                    P4      40-60 ms

 

            Average Turnaround Time = 131/4 =  32.75 ms

 

 

 

b)

 

            Processor 1

                        P1    00-20 ms

                        P3    20-70 ms

            Processor 2

                        P2    10-30 ms

                        P4    30-50 ms

P1    50-60 ms

 

            Draw the Gnatt Chart from the above data.

 

c)         Average Waiting Time  =    30/4   =  7.5 ms

 

 

 

 

Question 5)

 

 

a)      Round Robin

 

P1 Produced:  3

P2 Produced:   1

P3 Produced:  1

C1 Consumed:  2

 

b)      Priority: C1 will continue to execute

 

P1 Produced:  0

P2 Produced:   0

P3 Produced:  0

C1 Consumed:  0

 

c)      Priority

 

P1 Produced:  0

P2 Produced:   0

P3 Produced:  6

C1 Consumed:  4

 

d)     Blocking, instead of spinning

 

P1 Produced:  4

P2 Produced:   1

P3 Produced:  1

C1 Consumed:  4