Ask Question
11 December, 12:56

Illustrate that the system is in a safe state by demonstrating an order in which the threads may complete. If a request from thread T4 arrives for (2, 2, 2, 4), can the request be granted immediately? If a request from thread T2 arrives for (0, 1, 1, 0), can the request be granted immediately? If a request from thread T3 arrives for (2, 2, 1, 2), can the request be granted immediately?

+5
Answers (1)
  1. 11 December, 16:16
    0
    a. safe sequence is T2, T3, T0, T1, T4.

    b. As request (T4) = Available, so the request can be granted immediately

    c. As request (T2) < Available, so the request can be granted immediately

    d. As request (T3) < Available, so the request can be granted immediately.

    Explanation:

    It will require matrix

    [i, j] = Max [i, j] - Allocation [i, j]

    A B C D

    T0 3 3 3 2

    T1 2 1 3 0

    T2 0 1 2 0

    T3 2 2 2 2

    T4 3 4 5 4

    Available = (2 2 2 4)

    1. Need (T2) < Available so, T2 can take all resources

    Available = (2 2 2 4) + (2 4 1 3) (Allocation of T2) = (4 6 3 7)

    2. Need (T3)
    Available = (4 6 3 7) + (4 1 1 0) = (8 7 4 7)

    Like wise next T0, T1, T4 will get resources.

    So safe sequence is T2, T3, T0, T1, T4.

    (Note, there may be more than one safe sequence).

    Solution b.

    Request from T4 is (2 2 2 4) and Available is (2 2 2 4)

    As request (T4) = Available, so the request can be granted immediately.

    Solution c.

    Request from T2 is (0 1 1 0) and Available is (2 2 2 4)

    As request (T2) < Available, so the request can be granted immediately.

    Solution d.

    Request from T3 is (2 2 1 2) and Available is (2 2 2 4)

    As request (T3) < Available, so the request can be granted immediately.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Illustrate that the system is in a safe state by demonstrating an order in which the threads may complete. If a request from thread T4 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers