In a scenario where a mutex-protected resource must be accessed by multiple processes (not threads) across different machines, which synchronization primitive and approach is most appropriate, and why?
hard🎤 Interviewer Follow-up Q15 of Q15
Operating Systems - Semaphore vs Mutex - When to Use Which
In a scenario where a mutex-protected resource must be accessed by multiple processes (not threads) across different machines, which synchronization primitive and approach is most appropriate, and why?
AUse a binary semaphore implemented via a distributed lock service to enforce mutual exclusion across processes
BUse a distributed counting semaphore to limit concurrent access across machines
CUse a local mutex on each machine, since mutexes enforce ownership and prevent race conditions
DUse spinlocks on each machine to busy-wait until the resource is free