Correct Answer: D. To notify one or more waiting threads that the relevant state may have changed
Explanation:
A signal makes an eligible waiter runnable so it can recheck the condition while holding the lock.
Because the condition may change again, awakened threads normally test it in a loop.
A monitor groups shared state with operations that execute under implicit mutual exclusion.
This reduces the chance of forgetting to acquire and release an external lock correctly.
Correct Answer: A. It increments the semaphore and may wake a waiting process
Explanation:
The signal operation returns a resource unit or announces that an event has occurred.
A blocked waiter may become eligible to run after the count is increased.
Correct Answer: D. It attempts to decrement the semaphore and blocks if the resource is unavailable
Explanation:
The wait operation acquires one represented resource when the semaphore count permits it.
If none is available, the caller waits according to the semaphore implementation.
A counting semaphore maintains a nonnegative count corresponding to available resource instances.
Each acquisition decrements the count, and each release increments it.
A binary semaphore uses two logical states and can provide mutual exclusion or event signaling.
A counting semaphore represents multiple available units of a resource.
Correct Answer: A. To grant one thread at a time exclusive access to a protected resource
Explanation:
A mutex has ownership semantics and protects a critical section from concurrent conflicting access.
A thread acquires it before entering and releases it after leaving.
Correct Answer: D. The system as a whole continues making progress even if individual threads may be delayed
Explanation:
Lock-free progress means some operation completes in a finite number of system-wide steps despite contention.
It is weaker than wait-free progress, which guarantees completion for every individual thread.
Correct Answer: C. Its supported operations occur indivisibly with defined synchronization semantics
Explanation:
Atomic variables provide operations that other threads cannot observe halfway through.
They may store several data types and often support operations such as load, store, exchange, and compare-and-swap.
Correct Answer: B. To enforce ordering and visibility of memory operations across processors
Explanation:
Modern processors and compilers may reorder memory operations unless constrained.
A memory barrier ensures required reads and writes become visible in the intended order.
Correct Answer: A. Continuously checking a condition while consuming CPU cycles
Explanation:
Busy waiting repeatedly executes instructions while waiting for a state change.
Unlike blocking, it does not release the processor for other work during the wait.