Explore BrainMass
Share

Explore BrainMass

    Deadlock with three processes and three resources

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    We have 3 reusable resources. A,B,C. We have 3 process X,Y,Z, and each one of them uses periodically 2 of these 3 resources.
    Proc. X takes A, then B and then uses both A,B and then releases them.
    Proc. Y takes B, then C and then uses both B,C and then releases them.
    Proc. Z takes C, then A and then uses both C,A and then releases them.

    If 2 of the processes run "parallel" can we have deadlock? If yes, describe the scenario.
    If 3 of the processes run "parallel", describe a scenario with a deadlock.

    © BrainMass Inc. brainmass.com October 9, 2019, 8:03 pm ad1c9bdddf
    https://brainmass.com/computer-science/c/deadlock-processes-resources-137709

    Solution Preview

    The first question asks if we can get into a deadlock situation with two processes running. There are only three combinations that have two processes running:

    XY
    XZ
    YZ

    In the XY case X takes A and then B. Y takes B then C. If X has already taken B by the time that Y wants it then Y will have to wait. ...

    Solution Summary

    This solution examines the deadlock possibilities in the situation where there are three processes sharing three resources.

    $2.19