fix(guide): Fix all frontmatter

This commit is contained in:
Bouncey
2018-10-19 13:53:51 +01:00
committed by Stuart Taylor
parent 569bd7c3a7
commit 6d511c558a
146 changed files with 926 additions and 1469 deletions

View File

@ -1,4 +1,9 @@
# Deadlocks
---
title: Deadlock
---
## Deadlock
### The Deadlock Problem
- A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set.
- Example
@ -16,7 +21,7 @@
### Deadlock Characterization
Deadlock can arise if four conditions hold simultaneously.
- **Mutual exclusion** : only one process at a time can use a resource.
- **Mutual exclusion** : only one process at a time can use a resource.
- **Hold and wait** : a process holding at least one resource is waiting to acquire additional resources held by other processes.
- **No preemption** : a resource can be released only voluntarily by the process holding it, after that process has completed its task.
- **Circular wait** : there exists a set { P<sub>0</sub>, P<sub>1</sub>, …, P<sub>0</sub> } of waiting processes such that P<sub>0</sub> is waiting for a resource that is held by P<sub>1</sub>, P<sub>1</sub> is waiting for a resource that is held by P<sub>2</sub>, …, P<sub>n 1</sub> is waiting for a resource that is held by P<sub>n</sub>, and P<sub>0</sub> is waiting for a resource that is held by P<sub>0</sub>.
@ -28,16 +33,16 @@ Deadlock can arise if four conditions hold simultaneously.
### Deadlock Prevention
- **Mutual Exclusion** It is not required for sharable resources; must hold for nonsharable resources.
- **Hold and Wait** It must guarantee that whenever a process requests a resource, it does not hold any other resources.
- Require process to request and be allocated all its resources before it begins execution, or allow process to request resources only when the process has none.
- Low resource utilization; starvation possible.
- **No Preemption**
- If a process that is holding some resources requests another resource that cannot be immediately allocated to it, then all resources currently being held are released.
- **No Preemption**
- If a process that is holding some resources requests another resource that cannot be immediately allocated to it, then all resources currently being held are released.
- Preempted resources are added to the list of resources for which the process is waiting.
- Process will be restarted only when it can regain its old resources, as well as the new ones that it is requesting.
- **Circular Wait** It imposes a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration.