Question
Which of the following synchronization techniques is
used to resolve the Readers-Writers Problem efficiently?Solution
Semaphores are synchronization primitives used to manage access to shared resources in multi-threaded environments. In the Readers-Writers Problem, semaphores efficiently balance multiple readers accessing shared data simultaneously, while ensuring mutual exclusion for writers to avoid data inconsistency. The problem is solved using two semaphores: one for mutual exclusion (ensuring only one writer or a group of readers access the data) and another for resource access control. This ensures fairness and prevents issues like starvation of writers. Semaphores are widely used due to their flexibility and efficiency in solving synchronization problems. Why Other Options Are Incorrect: 1. Mutex Locks: Enforce strict mutual exclusion but cannot differentiate between readers and writers, leading to inefficiency. 2. Spinlocks: Suitable for short wait times but consume CPU cycles unnecessarily, making them inefficient. 3. Monitors: Provide higher-level synchronization but require language-level support, limiting their applicability. 4. Condition Variables: Complement mutexes but are not standalone synchronization mechanisms. Semaphores provide an optimal balance of efficiency and simplicity for resolving the Readers-Writers Problem.
Who is the Chairman and Managing Director of BHEL ?
Suggi is a traditional folk dance performed in which Indian state?
The government has allocated an additional ₹10,000 crore to which initiative to support start-ups in India?
Which state became the top producer and exporter of processed potatoes in India in 2024–25?Â
What major upgrade is NACH 3.0 expected to bring?Â
In which state is the Rihand Dam located?
Which mission was launched to boost manufacturing industries and strengthen the ‘Make in India’ initiative in FY25?
According to AIMS, by what percentage did the northern Great Barrier Reef’s coral cover decline after the 2024 bleaching event?Â
Why did the USAID suspend funding to Bangladesh in 2024?
Which aircraft currently offers WiFi services in Air India's domestic flights?