Operating Systems - Semaphore vs Mutex - When to Use WhichWhich of the following statements about binary semaphores and mutexes is INCORRECT?AA binary semaphore can be used to signal between threads without ownership enforcementBA mutex guarantees that only the thread that locked it can unlock itCA binary semaphore always enforces ownership semantics similar to a mutexDMutexes are typically used to protect critical sections, while binary semaphores are used for signalingCheck Answer
Step-by-Step SolutionStep 1: Review binary semaphore propertiesBinary semaphores do not enforce ownership; any thread can signal.Step 2: Review mutex propertiesMutex enforces ownership; only locking thread can unlock.Step 3: Analyze each statementA is correct; B is correct; C is incorrect because binary semaphores lack ownership enforcement; D is correct.Final Answer:Option C -> Option CQuick Check:Binary semaphore ownership enforcement is the key difference from mutex.Quick Trick: Binary semaphore ≠ mutex ownership enforcement.Common Mistakes:MISTAKESAssuming binary semaphore enforces ownership like mutexConfusing signaling with mutual exclusionBelieving mutexes are used for signalingTrap Explanation:PITFALLCandidates often conflate binary semaphore and mutex due to similar binary states, missing ownership enforcement distinction.Interviewer Note:CONTEXTTests ability to distinguish ownership and usage semantics between binary semaphore and mutex.
Master "Semaphore vs Mutex - When to Use Which" in Operating Systems2 interactive learning modes - each teaches the same concept differentlySolutionTrace
More Operating Systems Quizzes Banker's Algorithm - Safe State & Resource Allocation - Banker's Algorithm - Safe State & Resource Allocation - Quiz 7medium Context Switch - Cost & Causes - Context Switch - Cost & Causes - Quiz 5medium Inode Structure - File Metadata & Block Pointers - Inode Structure - File Metadata & Block Pointers - Quiz 1easy Process vs Thread - Key Differences - Process vs Thread - Key Differences - Quiz 14medium Round Robin Scheduling - Quantum & Turnaround Time - Round Robin Scheduling - Quantum & Turnaround Time - Quiz 14medium Round Robin Scheduling - Quantum & Turnaround Time - Round Robin Scheduling - Quantum & Turnaround Time - Quiz 5medium Shortest Job First (SJF) - Preemptive vs Non-Preemptive - Shortest Job First (SJF) - Preemptive vs Non-Preemptive - Quiz 9hard Shortest Job First (SJF) - Preemptive vs Non-Preemptive - Shortest Job First (SJF) - Preemptive vs Non-Preemptive - Quiz 14medium Starvation vs Deadlock vs Livelock - Differences & Examples - Starvation vs Deadlock vs Livelock - Differences & Examples - Quiz 7medium System Call - Mechanism & Modes (User vs Kernel) - System Call - Mechanism & Modes (User vs Kernel) - Quiz 13medium