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 Critical Section Problem - Requirements & Peterson's Solution - Critical Section Problem - Requirements & Peterson's Solution - Quiz 8hard Disk Scheduling - SSTF, SCAN, C-SCAN - Disk Scheduling - SSTF, SCAN, C-SCAN - Quiz 2easy File Allocation Methods - Contiguous, Linked, Indexed - File Allocation Methods - Contiguous, Linked, Indexed - Quiz 8hard File Allocation Methods - Contiguous, Linked, Indexed - File Allocation Methods - Contiguous, Linked, Indexed - Quiz 12easy Internal vs External Fragmentation - Compaction & Buddy System - Internal vs External Fragmentation - Compaction & Buddy System - Quiz 3easy Internal vs External Fragmentation - Compaction & Buddy System - Internal vs External Fragmentation - Compaction & Buddy System - Quiz 4medium Producer-Consumer Problem Using Semaphores - Producer-Consumer Problem Using Semaphores - Quiz 8hard Shortest Job First (SJF) - Preemptive vs Non-Preemptive - Shortest Job First (SJF) - Preemptive vs Non-Preemptive - Quiz 4medium Starvation vs Deadlock vs Livelock - Differences & Examples - Starvation vs Deadlock vs Livelock - Differences & Examples - Quiz 11easy System Call - Mechanism & Modes (User vs Kernel) - System Call - Mechanism & Modes (User vs Kernel) - Quiz 3easy