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

Assignment Help:

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.


Related Discussions:- Why we need to use a while statement when using wait method

Explain fifo page replacement, FIFO page replacement This is the easie...

FIFO page replacement This is the easiest page replacement algorithm. At this juncture the 1 st page entering is the 1 st to leave that is the oldest page leaves. To execute

Define how to manage the interaction of client and server, Managing the int...

Managing the interaction of client and server  Among the differences between traditional application programs and client server ones is that developers must create a mechanism

What is direct access, Normal 0 false false false EN-IN...

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Case studies, Did Abhinav agree to the initial timeline requested by Rebecc...

Did Abhinav agree to the initial timeline requested by Rebecca

Determine a policy that is not valid page replacement policy, Determine a p...

Determine a policy that is not a valid page replacement policy?  RU policy (Recurrently used) is not a valid page replacement policy.

Explain how protection is provided for the hardware resource, Explain how p...

Explain how protection is provided for the hardware resources by the operating system. Dual mode operation Sharing system resources needs operating system to make sure

Explain activities of an os in regard to file management, What are the five...

What are the five major activities of an operating system in regard to file management? The creation and deletion of files The creation and deletion of directories The s

What lead to the concept of paging?, What lead to the concept of paging? ...

What lead to the concept of paging? The main memory is separated into two parts that are one for the resident operating system, and one for the user processes. We may perhaps p

#title.paging, explain hierarchical,hashed and inverted paging

explain hierarchical,hashed and inverted paging

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd