01Chapter 1: The resource model: processes, resources, and instancesEvery deadlock question in GATE starts from the same model. A set of processes competes for a set of resources, and each resource type has a fixed number of interchangeable units. This chapter defines that model and the notation the later chapters use for the safety algorithm, the Banker's algorithm7 min read
02Chapter 2: What a deadlock is, and what it is notThis chapter assumes you know what processes and threads are, and how locks or semaphores enforce mutual exclusion. It also assumes you have seen the request, use, release cycle on resources from the previous chapter. Here we pin down the definition of deadlock and separate it from two conditions th6 min read
03Chapter 3: The four necessary conditionsThis chapter assumes you know what a process and a critical section are, and that you have used locks or semaphores for mutual exclusion. It also assumes you can read a directed graph and spot a cycle. The previous chapter defined deadlock as a set of processes where each one waits for a resource he6 min read
04Chapter 4: Resource-allocation graphs: when a cycle means deadlockThis chapter assumes you know what a deadlock is and can state the four Coffman conditions. It also assumes you can read a directed graph and spot a cycle in it. A resource-allocation graph (RAG) draws the system's state so you can see who holds what and who is waiting. Its main use is a quick test 6 min read
05Chapter 5: Four ways to handle deadlockThis chapter assumes you know the resource model (processes, resource types, instances, request-use-release) and the four Coffman conditions: mutual exclusion, hold and wait, no preemption, and circular wait. You should also be comfortable with directed graphs and with comparing vectors element by e6 min read
06Chapter 6: Prevention: breaking one Coffman conditionThis chapter assumes you know the four Coffman conditions (mutual exclusion, hold and wait, no preemption, circular wait), the basic resource model of processes and resource types, and how to use locks in a program. Prevention is the strictest of the handling strategies. It designs the system so tha6 min read
07Chapter 7: Safe and unsafe statesThis chapter assumes you know the resource model (processes, resource types, instances, request-use-release) and the four Coffman conditions. It also assumes you can compare two vectors element by element, for example [2, 1, 0] <= [3, 1, 2]. We stay with small examples and a hand check here. The n6 min read
08Chapter 8: The safety algorithm, step by stepThis chapter assumes you know what a safe state is (the previous chapter), and that you can read vectors and matrices and compare two vectors element by element. For vectors, X <= Y means X[j] <= Y[j] for every position j. If even one position fails, the comparison is false.6 min read
09Chapter 9: Banker's algorithm: granting or delaying a requestThis chapter assumes you know the safety algorithm from the previous chapter. That means the Available, Allocation, Max and Need structures, and the idea that a state is safe if some order lets every process finish. Here we use that test as a gatekeeper. Each time a process asks for resources, the s7 min read
10Chapter 10: Avoidance with claim edges for single-instance resourcesThis chapter assumes you know the resource-allocation graph from the earlier chapter (process nodes, resource nodes, request edges, assignment edges). It also assumes you know what a safe state is. The Banker's algorithm handles resources with many instances. This chapter covers the simpler case whe6 min read
11Chapter 11: Detection with a wait-for graphThis chapter assumes you can read a resource-allocation graph (RAG), where a request edge goes from a process to a resource and an assignment edge goes from a resource to a process. It also assumes you know what a cycle in a directed graph is, and that you have met the four Coffman conditions. Here 6 min read
12Chapter 12: Detection when resources have multiple instancesThis chapter assumes you know the safety algorithm from earlier in the tutorial, including the Available, Allocation and Need matrices. You should also be comfortable comparing vectors element by element and reading a wait-for graph.6 min read
13Chapter 13: Recovery: terminating processes and preempting resourcesThis chapter assumes you can already detect a deadlock. You should know the wait-for graph for single-instance resources and the matrix-based detection algorithm for multiple instances. You should also know the four Coffman conditions: mutual exclusion, hold and wait, no preemption, and circular wai7 min read
14Chapter 14: GATE problem patterns and shortcutsThis chapter collects the question types that appear most often in GATE and the fastest reliable method for each. It assumes you know the four Coffman conditions, resource-allocation graphs, the safety algorithm, the Banker's algorithm and the detection algorithms from the earlier chapters. You shou6 min read