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

Drawbacks of least-recently used algorithm, The question of fairness, regar...

The question of fairness, regarding page eviction, is a hard one. How do we decide what is fair? Many operating systems use global LRU, where pages from all processes are managed t

Explain fixed partitioning techniques, FIXED PARTITIONING In a fixed p...

FIXED PARTITIONING In a fixed partitioning, the operating system inhabiting some fixed portion of main memory is available for use of multiple processes -Using fixed partit

Research proposal, what topic i choose for os research proposal

what topic i choose for os research proposal

Difference between symmetric and asymmetric multiprocessing, Discuss differ...

Discuss difference between symmetric and asymmetric multiprocessing  Symmetric multiprocessing (SMP), in which every processor runs an identical copy of the operating system an

What is the mfd, What is the MFD? UFD? How are they related? MFD is mas...

What is the MFD? UFD? How are they related? MFD is master-file directory, which points to the UFDs. UFD is user-file directory, which points to each of user's files.

Define buffering, Define buffering. A buffer is a memory area that keep...

Define buffering. A buffer is a memory area that keeps data whereas they are transferred among two devices or among a device and an application. Buffering is done for three rea

Describe swapping technique in unix systems, Describe swapping technique in...

Describe swapping technique in UNIX systems. Swapping is used to control memory contention among processes. If there is excessively much memory contention, processes are swappe

Process destruction, Most process abstractions support processes being dest...

Most process abstractions support processes being destroyed when the program terminates, or in response to a specific kill directive. There are two common implementations, one a "p

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