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 8985281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:17:47+00:00 2026-06-15T21:17:47+00:00

I am trying to diagnose a production issue. I set up a little test

  • 0

I am trying to diagnose a production issue. I set up a little test program on Mac OS Lion that launches 10 threads (using Executors.newCachedThreadPool() which all call MUTEX.wait(), in a synchronized block)

Then I do a kill -3 to get a thread dump, and I see all of my threads showing BLOCKED.
Shouldn’t these all be WAITING?

The code is something like this, (forgive the code smells introduced for brevity)

ExecutorService executor = Executors.newCachedThreadPool();
final Object MUTEX = new Object();
for(int i = 0; i < 10; i++) {
   executor.execute(new Runnable() {
      public void run() {
        synchronized(MUTEX) {
         MUTEX.wait();
}  }   }}

At this point all threads should be in the WAITING state but in fact a thread dump shows all are BLOCKED

  • 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-15T21:17:49+00:00Added an answer on June 15, 2026 at 9:17 pm

    Because your threads are waiting for a monitor lock to enter a synchronized block/method, their status is BLOCKED.

    A thread that is blocked waiting for a monitor lock is in the BLOCKED state and a thread that is waiting indefinitely for another thread to perform a particular action is in the WAITING state.

    See below for more details about the difference between BLOCKED and WAITING:

    From the JavaDoc of BLOCKED:

    Thread state for a thread blocked waiting for a monitor lock. A thread
    in the blocked state is waiting for a monitor lock to enter a
    synchronized block/method or reenter a synchronized block/method after
    calling Object.wait.

    From the JavaDoc of WAITING:

    A thread in the waiting state is waiting for another thread to perform
    a particular action. For example, a thread that has called
    Object.wait() on an object is waiting for another thread to call
    Object.notify() or Object.notifyAll() on that object. A thread that
    has called Thread.join() is waiting for a specified thread to
    terminate.

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

Sidebar

Related Questions

I am trying to diagnose a problem with an internal production application. We have
I'm trying to diagnose a WCF service that is self-hosted in a relatively simple
I have a handle leak in a C# program. I'm trying to diagnose it
I'm trying to diagnose a problem in UKSyntaxColoredTextDocument 0.4 http://www.zathras.de/angelweb/blog-uksctd-oh-four.htm where text that actually
I am trying to clear up an issue that occurs with unflushed file I/O
I am trying to diagnose a problem on a server box that I believe
I have an odd situation occurring that I am trying to diagnose and would
I just spent way too long trying to diagnose why, in the following snippet
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
I am trying to diagnose this problem. TAB creates 4 spaces instead of a

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.