QUIZ on Keats Week 1 PDF

Title QUIZ on Keats Week 1
Course Operating Systems & Concurrency
Institution King's College London
Pages 9
File Size 227.6 KB
File Type PDF
Total Downloads 66
Total Views 146

Summary

QUIZ on Keats Week 1...


Description

QUIZ on Keats Week 1 Question 1: Select whether each of the following statements is true or false: A process can move directly from a new to a running state A process can move directly from a waiting to a terminated state A process can move directly from a waiting state to a ready state A process is an unchanging static collection of instructions The process control block is part of the process stored in memory

Question 2: Schedule the following processes using first come first served scheduling: P0 duration: 5 arrives: 4 priority: 4 P1 duration: 9 arrives: 0 priority: 0 P2 duration: 8 arrives: 13 priority: 13 P3 duration: 4 arrives: 14 priority: 14 P4 duration: 3 arrives: 5 priority: 5 What is the average turnaround time? Hint: each process runs until it finishes, processes start in the order they arrived, see the lecture notes for more details

Question 3: When using PUSH/PULL migration in multiprocessing a process regularly checks processor loads and redistributes processes. P1 (duration 7) P2 (duration 8) P3 (duration 13) are scheduled using FCFS scheduling, the shortest average waiting time will be achieved if the processes arrive in the order * __________. Starvation CAN/CANNOT occur when performing FCFS scheduling. Scheduling is most efficient when there is a mixture I/O and CPU bound processes/ processes are not making system calls/ all processes are I/O bound / all processes are CPU bound *P1

P2

P3 (in which order)

Question 4: Schedule the following processes using pre-emptive priority scheduling:

Process

Arrival

Duration

Priority

P0

4

12

16

P1

3

4

4

P2

8

13

10

P3

0

9

18

P4

6

4

17

Fill in the schedule below:

Process

Start Time

Runs For

Process

P3

P0

P1

P1

P0

P2

P2

P3

P0

P4

P4

TOTAL

P3

AVERAGE

13

9

4

8

Waiting time

11

Turnaround Time

14

Question 5: This question is about multi-queue scheduling. Select all the true statements from the list below: Select one or more:     

a. Multi-level feedback queues can be used for priority scheduling. b. In Multi-level feedback queue scheduling jobs always stay on the same queue. c. Multi-queue scheduling can be used on single processor systems. d. In multi-queue scheduling all queues must have the same scheduling algorithm. e. Time slicing can be used to allow sharing of resources between queues in multilevel queue scheduling! Another option is for higher priority queues to have absolute priority, using aging to prevent starvation.

Question 6:

Schedule the following processes using round robin scheduling with quantum 10:

Process

Arrival

Duration

P0

14

21

P1

0

19

P2

11

32

P3

50

35

P4

21

10S

Fill in the schedule below:

Process

Start Time

Runs For

Process

Waiting time

Turnaround Time

Question 7: Select whether each of the following statements is true or false:

13

9

4

8

11

14

SJF is a good algorithm for short-term scheduling as CPU burst lengths are easy to Predict Windows XP boosts the priority of a process after it exceeds its time quantum to prevent CPU hogging A child process always runs the same program as its parent In all operating systems a child process is killed if its parent is killed

Question 8: Schedule the following processes using round robin scheduling with quantum 10:

Process

Arrival

Duration

P0

0

11

P1

30

4

P2

10

10

P3

14

13

P4

9

3

Fill in the schedule below:

Process

Start Time

Runs For

Process

P0

P0

P4

P1

P2

P2

P3

P3

P1

P4

P3

TOTAL

Waiting time

Turnaround Time

AVERAGE

Answers Question 1: FALSE FALSE

13

9

4

8

11

14

TRUE FALSE FALSE Question 2: 11.6 Question 3: PUSH P1, P2, P3 CANNOT THERE IS A MIXTURE I/O AND CPU BOUND PROCESSES Question 4:

Waiting time

Turnaround Time

Process

Start Time

Runs For

Process

P3

0

3

P0

16

28

P1

3

4

P1

0

4

P0

7

1

P2

0

13

P2

8

13

P3

33

42

P0

21

11

P4

32

4

TOTAL

75

117

P3

36

6

AVERAGE

15

23.5

P3

P1 3

0

P0 7

P4

P2 8

26

P0 21

30

P4

P3

32

36

Turnaround Time for P0 = 32 – (8-7)- (7-4) = 28 (7-4): because Question 5: a,arrival c, e time is 4 and P0 is executed in 7 Question 6: The correct schedule is: 0: P1 (19)

13

9

4

8

11

14

42

19: P2 (10) 29: P0 (10) 39: P4 (10) 49: P2 (10) 59: P0 (10) 69: P3 (10) 79: P2 (10) 89: P0 (1) 90: P3 (10) 100: P2 (2) 102: P3 (15) Waiting times: P0 55 P1 0 P2 59 P3 32 P4 18 Turnaround times : P0 76 P2 91 P1 19 P3 67 P4 28

P3 0

P1

P0 7

3

P2 8

P0 21

P4 32

P3 36

Question 7: FALSE FALSE FALSE FALSE

Question 8:

Process

Start Time

Runs For

Process

Waiting time

Turnaround Time

42

P0

0

11

P0

0

11

P4

11

3

P1

0

4

P2

14

10

P2

4

14

P3

24

6

P3

14

27

P1

30

4

P4

2

5

P3

34

7

TOTAL

20

61

AVERAGE

P0

P4 11

0

13

P2 14

9

4

4

P3

P1

11

P3 34

30

24

8

12.2

14

41...


Similar Free PDFs