1.

Which method is called when a thread is blocked from running temporarily?(a) Pulse()(b) PulseAll()(c) Wait()(d) Both Pulse() & Wait()This question was addressed to me in exam.Enquiry is from Multithreaded Programming in portion Reflections, Multithreaded Programming, Collection Classes and Mathematical Functions of C#

Answer»

Correct option is (c) Wait()

Explanation: When a thread is temporarily blocked from RUNNING, it calls Wait( ). This causes the thread to GO to sleep and the lock for that OBJECT to be released, ALLOWING ANOTHER thread to acquire the lock.



Discussion

No Comment Found

Related InterviewSolutions