Multiple choice technology programming languages

Which Method Notifies A Thread In The Waiting Queue Of A Change In The Locked Object's State?

  1. Thread.GetData

  2. Monitor.Pulse

  3. Thread.SpinWait

  4. Monitor.Wait

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Monitor.Pulse notifies a single waiting thread in the waiting queue that the locked object's state has changed. The waiting thread can then re-acquire the lock and proceed. Thread.GetData retrieves thread-local data, Thread.SpinWait is a busy-wait mechanism, and Monitor.Wait releases the lock and puts the thread in the waiting queue.