1.

What kind of exception is being thrown if Wait(), Pulse() or PulseAll() is called from code that is not within synchronized code?(a) System I/O Exception(b) DivideByZero Exception(c) SynchronizationLockException(d) All of the mentionedThis question was addressed to me in an interview for internship.Query is from Multithreaded Programming topic in portion Reflections, Multithreaded Programming, Collection Classes and Mathematical Functions of C#

Answer»

Correct ANSWER is (c) SynchronizationLockException

The explanation: A SynchronizationLockException will be thrown if Wait(), Pulse(), or PULSEALL() is called from CODE that is not within synchronized code, such as a LOCK block.



Discussion

No Comment Found

Related InterviewSolutions