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.
Individuals A and B have their incomes in the ratio of 5 to 3, while the ratio of their expenditures stands at 3 to 4, respectively. A saves Rs. 43,000 ...
In a department 20% of the employees are females. 40% of the male employees know Hindi. The total number of employees who know Hindi is 46%. Find the pe...
In a school, 60% of the students pass and 30 fail. The number of students appearing from another school is 25 more and 20 more students pass than the fo...
40% students (boys + girls) in a science class are boys. Out of total boys, 60% are literate and 120 are illiterate. Find the number of literate girls i...
A teacher distributes 300 toffees among her 4 students, A, B, C and D. A gets x% of total toffees, B receives 2x% of the remaining toffees, C receives (...
The current population of a city is 50,000. If the population of males increases by 4% and the population of females increases by 6%, the total populati...
A quantity is increased by 60% at first, and later decreased by 45%. Calculate the net percentage change.
'P' allocates 25% of his income to rent and then spends 40% of the remaining amount on food and travel. After these expenses, he spends Rs. 5600 on misc...
Akshay, Vishal and Dipak purchased 2, 20 and 50 notebooks for a total of Rs 16, Rs 140 and Rs 400 respectively from a stationery shop. In his transactio...
In a colony, there are 20 APL families and 30 BPL families. Each APL and BPL family got blankets equal to 30% and 60%, respectively of total number of f...