Chapter 5 & 7 (Quiz 5 Portion) Flashcards
What is the “Critical section” problem?
1- Process may be changing common variables, updating table, writing file, etc.
2- When one process in critical section, no other may be in its critical section.
What are the solutions to Critical-Section problem?
1- Mutual Exclusion.
2- Progress.
3- Bounded Waiting.
What is “Mutual Exclusion” ?
If process Pi is executing in its critical section, then no other processes can be executing in their critical sections.
What is “Progress” ?
If no process is executing in its critical section and there exist some processes that wish to enter then cannot be postponed indefinitely.
What is the difference between Preemptive & Non-preemptive kernel in Critical-Section Handling in OS?
1- Preemptive : allows preemption of process when running in kernel mode.
2- Non-preemptive : runs until exits kernel mode, blocks, or voluntarily yields CPU.
Is there Critical-Section in Hardware? and why?
No, because of using locking.
What is the difference between “Uniprocessors” & “Modern machines” ?
Uniprocessors : could disable interrupts.
Modern machines : Atomic = non-interruptible.
What is “Semaphore”?
Synchronization tool that provides more sophisticated ways (than Mutex locks) for process to synchronize their activities.
What is “Starvation” in Process Synchronization?
A process may never be removed from the semaphore queue in which it is suspended.
What is “Priority Inversion”?
Scheduling problem when lower-priority process holds a lock needed by higher-priority process.
What are the Classical Problems of Synchronization?
1- Bounded-Buffer Problem.
2- Readers and Writers Problem.
3- Dining-Philosophers Problem.
What is the Readers and Writers Problem?
Allow multiple readers to read at the same time.
What is the Solution to the Readers and Writers Problem?
Using Priorities.
How does a process utilizes a resource?
1- Request.
2- Use.
3- Release.
What are the Deadlock Characterization?
1- Mutual exclusion.
2- Hold and wait.
3- No preemption.
4- Circular wait.
What is the “Mutual exclusion” from Deadlock Characterization?
Only one process at a time can use a resource.
What is the “Hold and wait” from Deadlock Characterization?
A process holding at least one resource is waiting to acquire additional resources held by other processes.
What is the “No preemption” from Deadlock Characterization?
A resource can be released only voluntarily by the process holding it, after that process has completed its task.
What happens if Resource allocator graph contains no cycles?
No deadlock.
What happens if Resource allocator graph contains a cycle?
1- If only one instance per resource type, then deadlock.
2- If several instances per resource type, possibility of deadlock.
What is the “Mutual Exclusion” from the deadlock prevention?
Not required for sharable resources (read-only files).
What is the “Hold and wait” from the deadlock prevention?
Must guarantee that whenever a process requests a resource, it does not hold any other resources.
What is the “No preemption” from the deadlock prevention?
If a process that is holding some resources requests another resource that cannot be immediately allocated.
What is the “Circular wait” from the deadlock prevention?
Impose a total ordering of all resource types.
What happens if a system is in a safe state?
No deadlock.
What happens if a system is in a unsafe state?
Possibility of deadlock.
What is “Avoidance”?
Ensure that a system will never enter an unsafe state.
What are the points for Recovery from Deadlock?
1- Process Termination.
2- Resource preemption.
What is the “Process Termination” in Recovery from Deadlock?
1- Abort all deadlocked processes.
2- Abort one process at a time until the deadlock cycle is eliminated.
In which order should we choose to abort? (Mention at least 5)
1- Priority of the process.
2- How long process has computed, and how much longer to completion.
3- Resources the process has used.
4- Resources process needs to complete.
5- How many processes will need to be terminated.
6- Is process interactive or batch?.
What is the “Selecting a victim” from Resource Preemption?
Minimize cost.
What is the “Rollback” from Resource Preemption?
Return to some safe state, restart process for that state.
What is the “Starvation” from Resource Preemption?
Same process may always be picked as victim.