Given the following System with a maximum of 18 devices: Job No. Devices Allocated Maximum Required Remaining Needs Job 1 6 8 X Job 2 2 9 X Job 3 5 8 X Job 4 3 5 X Using the Banker’s Algorithm, answer these questions: a. Calculate the number of available devices. b. Determine the remaining needs for each job in each system. c. Determine whether the system is safe or unsafe.

Respuesta :

Complete Data:

Job No.          Devices Allocated       Maximum Required       Remaining Need

Job 1                          6                                        8                                    X

Job 2                          2                                        9                                    X

Job 3                          5                                        8                                    X

Job 4                          3                                         5                                   X    

Answer:

a) Number of available devices = 2

b) Remaining need for job 1 = 2

Remaining need for job 2 = 7

Remaining need for job 3 = 3

Remaining need for job 4 = 2

c) The system is safe

Explanation:

a) Calculate the number of available devices

Number of available devices = (Maximum number of devices) - (Total number of devices allocated)

Maximum number of devices  = 18

Total number of allocated devices = (6 + 2 + 5 + 3)

Total number of allocated devices = 16

Number of available devices = 18 - 16

Number of available devices = 2

b) Determine the remaining needs for each job in each system

Remaining needs = (Maximum Required - Number of devices allocated)

For Job 1

Remaining need = 8 - 6 = 2

For Job 2

Remaining need = 9 - 2 = 7

For Job 3

Remaining need = 8 - 5 = 3

For Job 4

Remaining need = 5 - 3 = 2

c) Determine whether the system is safe or unsafe

For the system to be safe, Need ≤ Available

Where New Available = Available + Allocation

For Job 1

Need = 2

Available devices = 2

2 ≤ 2   (Job 1 is safe)

New available = 2 + 6 = 8

For Job 2

Need = 7

Available devices = 8

7 ≤ 8   (Job 2 is safe)

New available = 2 + 8 = 10

For Job 3

Need = 3

Available devices = 10

3 ≤ 10   (Job 3 is safe)

New available = 5 + 10 = 15

For Job 4

Need = 2

Available devices = 15

2 ≤ 15   (Job 2 is safe)

New available = 3 + 15 = 18

Since all the jobs are safe, the system is safe