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

  • Home
  • SEARCH
  • 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 8807935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:29:32+00:00 2026-06-14T02:29:32+00:00

Is it possible for a thread to do some operations before being Waited ,

  • 0

Is it possible for a thread to do some operations before being Waited , what I want to do is that I want this thread to wait() another thread before being waited itself,

It’s a distributed system with Clients, a Transaction Manager, and a Lock Manager which the last two reside on a middleware server. The Lock Manager may wait() a thread of Transaction Manager, I want this thread to be able to wait() Client thread before being waited itself.

  • 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-14T02:29:33+00:00Added an answer on June 14, 2026 at 2:29 am

    You cannot “wait” another thread. If you call wait() on an object, all it does is sending the current thread to sleep until it is notified (by notify() or notifyAll()) or due to a so called spurious wake-up. I would recommend reading the “Lesson: Concurrency” from the Java Tutorials. Especially the part about guarded blocks should be of interest to you.

    So, if you want to tell some other thread that you are about to start waiting on an object, for example like this

    // We are somewhere, in some method ...
    synchronized(someObj) {
        someObj.wait();
    }
    

    you have to implement some kind of observer pattern, where other objects can be registered.

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

Sidebar

Related Questions

I want to create a background thread on the iPhone that executes some code
I want to execute some operations on a worker thread while displaying a progress
So, as soon as I hit a breakpoint in some thread, is it possible
Possible Duplicate: Return value from thread I want to get the free memory of
Possible Duplicate: Is stl vector concurrent read thread-safe? I have a multi-threaded program that
I have some long-running operations that number in the hundreds. At the moment they
I want to move some code that takes a couple seconds to generate a
Possible Duplicate: WPF and cross thread operations I am having trouble with a window
At some point of my server application I want to stop some threads that
I'm trying to put some time-consumed database operations into the background thread with the

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.