Question
Which of the following is a key challenge in handling
deadlocks in an operating system?Solution
Detailed Explanation: Deadlocks occur when a set of processes is blocked because each process is holding a resource and waiting for another resource held by another process. One of the primary methods for detecting deadlocks is using the resource allocation graph (RAG) . A cycle in this graph indicates a potential deadlock when resources are not reusable or preemptible. Detecting cycles involves examining the directed graph of resources and processes to find circular dependencies. Algorithms like Depth First Search (DFS) are commonly used for this purpose in deadlock detection. Deadlock detection is critical in systems where prevention or avoidance mechanisms are impractical, such as distributed systems. Once detected, the system must recover by terminating one or more processes or preempting resources, which can be complex and resource-intensive. Why Other Options Are Incorrect:
- Option A: Allocating resources fairly is more related to system performance and fairness policies rather than deadlock handling. Fairness does not directly address circular wait or hold-and-wait conditions.
- Option B: Preventing starvation is a separate issue. Starvation happens when low-priority processes wait indefinitely, often due to poor scheduling, not necessarily because of deadlocks.
- Option D: FCFS is a scheduling algorithm that manages the sequence of process execution but does not directly address or solve deadlocks.
- Option E: Managing shared memory involves synchronization and mutual exclusion issues but is not inherently about detecting cycles in deadlocks.
Find the smallest number greater than 100 which, when divided by 8, 12 and 15, leaves a remainder of 5 in each case.
Indicate the numbers that are divisible by both 2 and 3.
Find the median of 5, 6, 10, 7, 7, 8, 6, 5 and 12.
"PQR is a three-digit number such that it can be expressed as the sum of its three two-digit components, PQ, QR, and RP, where all of them are natural n...
A number leaves a remainder of 12 when divided by 19. What will be the remainder when three times that number is divided by 19?
How many whole numbers between 100 and 750 are multiples of both 18 and 24?
Sum of squares of three consecutive numbers is 677. Find the sum of first and third number.
Three numbers are in the ratio 2:5:7. If the difference between the sum of the smallest and the largest number and the sum of the smallest and the secon...
Dev has joined Snapchat and has 20 friends and each of these friends has 40 friends. Later, it is found that at least two of his friends know each other...
The first number is four times 60% of the second number. If the second number is increased by 5, the first number becomes twice the new value of the sec...