Question
In the context of inter-process communication (IPC),
which of the following mechanisms is used to ensure that only one process accesses a resource at a time?Solution
A Mutex (Mutual Exclusion) is a synchronization primitive used to prevent concurrent processes from accessing a shared resource simultaneously. By locking the resource when one process is using it, a mutex ensures that other processes must wait until the resource is released. This prevents data corruption and ensures that critical sections of code are executed safely, thereby facilitating proper synchronization in multi-threaded applications. Option A (Semaphore) is incorrect because, while it can also be used for synchronization, it allows a certain number of processes to access a resource concurrently, which does not guarantee exclusive access. Option C (Message Queue) is incorrect as it is primarily used for communication between processes rather than controlling access to shared resources. Option D (Shared Memory) allows multiple processes to access the same memory segment, but it does not inherently provide mechanisms for synchronization. Option E (Pipe) is incorrect because pipes are used for communication between processes but do not provide mutual exclusion for shared resources.
- Select the number from among the given options that can replace the question mark (?) in the following series.
17, 18, 22, 31, 47, ___ - Which letter and number cluster will replace the question mark (?) to complete the given series?
LT6, KU12, IW24, FZ48, ____ - A series is given with one term missing. Choose the correct alternatives from the given ones that will complete the series.
57, 59, 56, 61, 54, ___ - Which letter-cluster will replace the question mark (?) in the following series?
RGV, UME, ?, AYW, DEF - Which letter-cluster will replace the question mark (?) in the following series?
NPQR, OORQ, PNSP, ____, RLUN