Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8958043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:07:59+00:00 2026-06-15T15:07:59+00:00

According to a colleague, JVM does not guarantee that when calling notify on an

  • 0

According to a colleague, JVM does not guarantee that when calling “notify” on an object, the correct “wait” will be notified at that time. He says there can be a case when a previous notify which is not valid anymore is delivered at an invalid time.

Is this true? If so, how/why is this, and what use is the wait/notify mechanism if you cannot assume something as basic as this will work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:08:00+00:00Added an answer on June 15, 2026 at 3:08 pm

    For java.lang.Object.notify, The Javadoc says:

    Wakes up a single thread that is waiting on this object’s monitor. If
    any threads are waiting on this object, one of them is chosen to be
    awakened. The choice is arbitrary and occurs at the discretion of the
    implementation. A thread waits on an object’s monitor by calling one
    of the wait methods.

    Here is a pattern to wait for a particular condition:

    synchronized( lock ) {
       while( conditionEvaluation( data )) {
          lock.wait();
       }
    }
    

    The counterpart should use java.lang.Object.notifyAll() to ensure the vivacity of the application. Even if today, it’s only one waiter, after many evolutions of the software, it may be several waiters in the future, so notifyAll() is more robust than notify().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to this article I know, that DateTimePicker control does not reflect CurrentUICulture So,
According to what I've heard, integer values that are not the processor's word size
According to another answer , an rvalue reference will not extend the lifetime of
According to PHP.net manual, pg_pconnect will create a persistent connection, or will return the
According MSDN, FxCop is an application that analyzes managed code assemblies (code that targets
According this article , generic JPA DAO(Data Access Object) is a pretty nice pattern.
According to Hibernate documentation : After observing that arrays cannot be lazy , you
According to this discussion , the iphone agreement says that it doesn't allow loading
According to the manual , git dcommit will create a revision in SVN for
According to C++11 9.1/7 (draft n3376) , a standard-layout class is a class that:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.