l2
"/home/yossef/notes/Su/os2/l2.md"
path: Su/os2/l2.md
- **fileName**: l2
- **Created on**: 2026-01-03 17:05:41
deadlock: a set of blocked from two process holding each one resources
and waiting to require the resource that is hold from each other
deadlock can arise if four conditions hold:
- mutual exclusion; only one process each time
- hold and wait: a process holding only one resource
- no preemption: a resource can be released only voluntraily by the process
that is holding the resource - Circular await: there is a exiting of set waiting for resources from
specific process
Transaction Management and Recovery Summary
| Topic | Key Concept Description |
|---|---|
| Checkpoints | Shorten logs and recovery time by flushing data to disk. |
| Serializability | A schedule where transactions , execute atomically. |
| Conflict | Two operations conflict if they access same item with one write. |
| No Preemption | Resources are released if a new request cannot be fulfilled. |
Detailed Notes
Mutual Exclusion: Required only for non-sharable resources.
Hold and Wait: Process must not hold resources when requesting.
These constraints may lead to low utilization or starvation.
No Preemption (Deadlock Prevention)
- If a process holding resources requests another unavailable one.
- All resources currently being held by that process are released.
- This prevents a process from waiting indefinitely while holding.
(Safe State)A system is in a safe state if there exists a specific sequence of
processes where every process can complete its task. For any process
in that sequence, its future resource requirements can be met by the
resources currently free plus those held by processes before it.
- If a process's needs aren't ready, it waits for prior tasks.
- Once previous tasks finish, the waiting process takes the gear.
- It completes its work and returns all resources to the system.
- This cycle repeats until every process has finished successfully.
A Claim edge Pi -> Rj indicates that a process Pi may request a
resource Rj at some point in the future. In a resource-allocation
graph, this specific type of edge is represented by a dashed line.
- It shows potential future requests rather than current ones.
- When a process actually requests the resource, the dashed claim
banker algorithm
BANKER'S ALGORITHM:
-
Each process must declare its maximum possible resource use upfront.
-
When a process requests a resource, it may be forced to wait.
-
Once a process finishes, it must return resources in finite time.
continue:./l3.md
before:./reversion_final_l1.md