Question

    How can the Banker's algorithm be used to prevent

    deadlocks?
    A By killing processes that are in a deadlock state. Correct Answer Incorrect Answer
    B By ensuring that at least one process releases all of its resources before requesting new ones. Correct Answer Incorrect Answer
    C By dynamically allocating resources to processes and only granting requests that leave the system in a safe state. Correct Answer Incorrect Answer
    D By immediately releasing all resources held by a process that enters a waiting state. Correct Answer Incorrect Answer
    E None of these Correct Answer Incorrect Answer

    Solution

    The Banker's algorithm is used to prevent deadlocks by considering the current resource allocation, future resource requests, and the available resources. It only allows a resource request if granting it would not put the system in an unsafe state, ensuring that processes don't enter deadlock-prone situations.

    Practice Next

    Relevant for Exams: