1.

Which of this method is used to avoid polling in Java?(a) wait()(b) notify()(c) notifyAll()(d) all of the mentionedI got this question in my homework.The query is from Creating Threads in portion Multithreading of Java

Answer»

Correct choice is (d) all of the mentioned

The best explanation: Polling is a USUALLY implemented by looping in CPU is wastes CPU TIME, one thread being executed depends on other thread output and the other thread depends on the response on the data given to the first thread. In such situation CPU time is wasted, in JAVA this is avoided by using METHODS wait(), notify() and notifyAll().



Discussion

No Comment Found

Related InterviewSolutions