In a resource allocation graph, what does a directed edge from a process node to a resource node represent?
Think about what it means when a process points to a resource in the graph.
A directed edge from a process to a resource means the process is requesting that resource. Conversely, an edge from a resource to a process means the resource is allocated to that process.
Which condition in a resource allocation graph indicates a deadlock?
Deadlock happens when processes wait indefinitely. What does a cycle represent?
A cycle in the resource allocation graph means a set of processes are waiting for resources held by each other, causing deadlock.
Given a resource allocation graph where process P1 holds resource R1 and requests resource R2, while process P2 holds resource R2 and requests resource R1, what does this situation represent?
Consider if the processes can proceed or are stuck waiting for each other.
Each process holds a resource the other needs and waits for the other's resource, forming a cycle and causing deadlock.
Which statement correctly distinguishes a resource allocation graph from a wait-for graph?
Think about what nodes each graph contains.
A resource allocation graph includes both processes and resources as nodes, while a wait-for graph simplifies this by showing only processes and edges representing waiting relationships.
Consider a system with 3 processes (P1, P2, P3) and 2 resources (R1, R2). P1 holds R1 and requests R2, P2 holds R2 and requests R1, and P3 requests R2 but holds no resources. How many edges are in the resource allocation graph?
Count edges from processes to resources (requests) and from resources to processes (allocations).
Edges: P1 → R2 (request), R1 → P1 (allocation), P2 → R1 (request), R2 → P2 (allocation), P3 → R2 (request). Total 5 edges.