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:

  1. mutual exclusion; only one process each time
  2. hold and wait: a process holding only one resource
  3. no preemption: a resource can be released only voluntraily by the process
    that is holding the resource
  4. 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)

(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.

  1. If a process's needs aren't ready, it waits for prior tasks.
  2. Once previous tasks finish, the waiting process takes the gear.
  3. It completes its work and returns all resources to the system.
  4. 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.

banker algorithm

BANKER'S ALGORITHM: