Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Safe state, banker’s algorithm, deadlock detection?

Ook bekend als: safe state · banker's algorithm · deadlock detection

Definition 13.6 University Computer Science — Year 3 · Hoofdstuk 13 — Concurrency: Deadlock, Monitors and Lock-Free Structures

Each thread ii declares a maximum claim; it holds alloci\mathit{alloc}_i and may still ask for needi\mathit{need}_i, the claim minus what it holds; available\mathit{available} is what nobody holds. A state is a safe state if there is an order of the threads in which each can be given its whole need\mathit{need} from what is available plus what the threads before it have returned, then finish and return everything. The banker’s algorithm grants a request only if the state after granting it is safe, and otherwise makes the thread wait. Deadlock detection lets threads request freely, and from time to time searches for a set of threads deadlocked in the current state, to break the deadlock by killing or rolling back one of them.

Lees in het hoofdstuk →