What is the primary purpose of synchronization in operating systems?
To manage access to shared resources and prevent race conditions.
True or False: A semaphore can be used to control access to a resource by multiple processes.
True
Fill in the blank: A _______ is a signaling mechanism that can be used for process synchronization.
semaphore
What are the two types of semaphores?
Counting semaphores and binary semaphores.
What is a deadlock?
A situation where two or more processes are unable to proceed because each is waiting for the other to release resources.
Multiple Choice: Which of the following is NOT a condition for a deadlock to occur? A) Mutual Exclusion B) Hold and Wait C) No Preemption D) Resource Sharing
D) Resource Sharing
What is deadlock prevention?
A strategy to ensure that at least one of the necessary conditions for deadlock cannot hold.
True or False: Deadlock avoidance requires knowledge of future requests.
True
What does the Banker’s Algorithm do?
It is used to avoid deadlock by determining whether resource allocation will lead to a safe state.
Fill in the blank: A _______ state is one in which a system can allocate resources to all processes without leading to a deadlock.
safe
What is deadlock detection?
A method to check for the presence of deadlocks in a system.
Multiple Choice: Which algorithm is commonly used for deadlock detection? A) FIFO B) Round Robin C) Wait-Die Scheme D) Wait-For Graph
D) Wait-For Graph
What is the purpose of deadlock recovery?
To take action to resolve a deadlock situation once it has been detected.
True or False: One way to recover from a deadlock is to terminate one or more processes.
True
Fill in the blank: The _______ condition states that resources cannot be forcibly taken from a process holding them.
no preemption
What is the role of a mutex in process synchronization?
A mutex is a locking mechanism that ensures mutual exclusion when accessing shared resources.
Multiple Choice: Which of the following is a characteristic of binary semaphores? A) Can take any integer value B) Can only take values 0 or 1 C) Can be incremented D) Can be decremented
B) Can only take values 0 or 1
What is a race condition?
A situation where the outcome of a process is unexpectedly affected by the timing of other concurrent processes.
True or False: Starvation can occur if a process is perpetually denied the resources it needs to proceed.
True
What is a wait-for graph?
A directed graph used to represent the allocation of resources and the waiting relationships between processes.
Fill in the blank: The _______ method allows processes to request resources in a way that avoids deadlock.
resource allocation
What is priority inversion?
A scenario where a higher priority task is waiting for a lower priority task to release a resource.
Multiple Choice: Which of the following is a deadlock prevention technique? A) Wait-Die B) Hold and Wait C) Circular Wait D) Resource Allocation Graph
A) Wait-Die
What is the difference between deadlock avoidance and deadlock detection?
Deadlock avoidance prevents deadlock from occurring, while deadlock detection identifies deadlock after it has occurred.