Most Likely Flashcards
Deadlock occurs when
every process in a set is waiting for an event that can only be caused by another process in the set
Deadlock can occur only when the following four conditions are satisfied:
Mutual exclusion
Hold and wait
No preemption
Circular wait
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
here exists a set {P0, P1, …, Pn} of waiting processes such that P0 is waiting for a resource that is held by P1, P1 is waiting for a resource that is held by P2, …, Pn-1 is waiting for a resource that is held by Pn, and Pn is waiting for a resource that is held by P0.
A directed edge from a process to a resource is
called a request edge in system resource-allocation graph
The assignment edge is
a directed edge from a resource to a process.
A cycle in a resource-allocation graph is
not a sufficient condition for deadlock in the case that each resource has more than one instance.
A cycle in a resource-allocation graph is sufficient and necessary only
if each resource has only one instance.
Most OS pretend that deadlock
will never happen and leave it up to the responsibility of application programmer.
An unsafe state may lead to a
deadlocked state, but not necessary must lead to.
contiguous memory allocation
each process is contained in a single section of memory that is contiguous to the section containing the next process
With contiguous memory allocation, all portions of a process must be loaded into sequential physical memory partitions.
First fit
Allocate program to the first partition big enough to hold it
Best-fit
The allocator places a process in the smallest block of unallocated memory in which it will fit.
has the least wasted space and the smallest partition fitting the requirements.