Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Two threads waiting on a object Monitor

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Two threads waiting on a object Monitor

    Hi,

    Two threads seems to be in WAITING indefinately(VisualVM shows 100% Waiting)..
    The following is a block from thread dump


    "EventWriter-2" daemon prio=10 tid=0x00007f7764b54800 nid=0x33c5 in Object.wait() [0x00007f7762442000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000006895bc720> (a it.gotoandplay.smartfoxserver.lib.ChannelQueue)
    at java.lang.Object.wait(Object.java:502)
    at it.gotoandplay.smartfoxserver.lib.ChannelQueue.deQ ueue(ChannelQueue.java:51)
    - locked <0x00000006895bc720> (a it.gotoandplay.smartfoxserver.lib.ChannelQueue)
    at it.gotoandplay.smartfoxserver.EventWriter.run(Even tWriter.java:73)
    at java.lang.Thread.run(Thread.java:636)

    Locked ownable synchronizers:
    - None

    "EventWriter-1" daemon prio=10 tid=0x00007f7764324800 nid=0x33c4 in Object.wait() [0x00007f7762543000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000006895bc720> (a it.gotoandplay.smartfoxserver.lib.ChannelQueue)
    at java.lang.Object.wait(Object.java:502)
    at it.gotoandplay.smartfoxserver.lib.ChannelQueue.deQ ueue(ChannelQueue.java:51)
    - locked <0x00000006895bc720> (a it.gotoandplay.smartfoxserver.lib.ChannelQueue)
    at it.gotoandplay.smartfoxserver.EventWriter.run(Even tWriter.java:73)
    at java.lang.Thread.run(Thread.java:636)

    Locked ownable synchronizers:
    - None

    These are the only 2 threads that are accessing the corresponsing object.

    Can 2 threads waiting on same object monitor ?.
    Can somebody help with what could be the issue here and what should be done ?

    Thanks..


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Two threads waiting on a object Monitor

    We can't really help you without an SSCCE that demonstrates the problem.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Runtime.Exec() not waiting
    By PrinceSendai in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: June 9th, 2011, 02:12 PM
  2. Waiting for a Second JButton Click
    By Firebert in forum Java Theory & Questions
    Replies: 0
    Last Post: March 16th, 2011, 08:15 PM
  3. Using Thread waiting() method
    By nicoeschpiko in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 11th, 2010, 11:55 AM
  4. Waiting until condition
    By aussiemcgr in forum Java Theory & Questions
    Replies: 1
    Last Post: October 22nd, 2010, 09:24 AM
  5. Monitor the progress of sending a file to client
    By adumi in forum Java Theory & Questions
    Replies: 0
    Last Post: April 17th, 2010, 07:01 AM