Why we need to use a while statement when using wait method, Operating System

Q. The wait() statement in every Java program examples was part of a while loop. Describe why you would always need to use a while statement when using wait() and why you would never use an if statement.

Answer: This is a significant issue to emphasize! Java only provides anonymous notification-you can't notify a certain thread that a certain condition is true. When a thread is informed it is its responsibility to re-check the condition that it is waiting for. If a thread didn't recheck the condition it might have received the notification without the condition having been met.

Posted Date: 7/27/2013 3:55:31 AM | Location : United States







Related Discussions:- Why we need to use a while statement when using wait method, Assignment Help, Ask Question on Why we need to use a while statement when using wait method, Get Answer, Expert's Help, Why we need to use a while statement when using wait method Discussions

Write discussion on Why we need to use a while statement when using wait method
Your posts are moderated
Related Questions
How does an operating system make multiprogramming possible by using single processor?

Ask using a laballed diagram explaining the architecture of windows operating ststem

Minor page fault :I f the page is loaded in memory at the time the fault is started, but is not checked in the memory management unit as being loaded in memory, then it is named a

The permission function is used to calculate what, if any access each class or level of user has to each file on a Unix machine. The permission task is one of the data components s


What is contiguous allocation? Allocation of a group of consecutive sectors for a one file.

Q. Does Windows XP offer any user-mode processes that enable it to run programs developed for other operating systems? Describe two of these subsystems. Answer: Environmental

A system consists of 10 units of resource class Ru. The resource needs of three user processes P1, P2 and P3 are like this                     Using Banker's algorithm, de

Q. Presume that the following processes arrive for execution at the times indicated. Every process will run the listed amount of time. In responding the questions use non pre-empti

Determine the syntax of the assembler directive EQU The following is syntax of the assembler directive EQU: EQU