How can multiple threads hold the same lock?

I was always under the impression that no 2 threads could hold a lock for the same object, and yet the HotSpot traces say this is happening all the time.
For example Object 0x0a6c1bf8 is locked in 2 threads:
"10.129.24.35-1" daemon prio=6 tid=0x2836bad0 nid=0x9d4 runnable [0x2b28f000..0x2b28fc9c]
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
- locked <0x2493f6e0> (a java.net.SocksSocketImpl)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at org.jacorb.orb.factory.PortRangeSocketFactory.doCreateSocket(PortRangeSocketFactory.java:142)
at org.jacorb.orb.factory.AbstractSocketFactory.createSocket(AbstractSocketFactory.java:54)
at org.jacorb.orb.iiop.ClientIIOPConnection.createSocket(ClientIIOPConnection.java:313)
at org.jacorb.orb.iiop.ClientIIOPConnection.connect(ClientIIOPConnection.java:160)
- locked <0x0a6c1b98> (a org.jacorb.orb.iiop.ClientIIOPConnection)
at org.jacorb.orb.giop.GIOPConnection.sendMessage(GIOPConnection.java:934)
- locked <0x0a6c1bf8> (a java.lang.Object)
at org.jacorb.orb.giop.GIOPConnection.sendRequest(GIOPConnection.java:900)
at org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:323)
at org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:304)
at org.jacorb.orb.Delegate.invoke_internal(Delegate.java:1024)
- locked <0x0d434a88> (a java.lang.Object)
at org.jacorb.orb.Delegate.invoke(Delegate.java:939)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:80)
at com.company.MyApp._StateChangeListenerStub.newChanges(_StateChangeListenerStub.java:33)
at com.company.MyAppManager.ListenerOneway.send(ListenerOneway.java:65)
at com.company.MyAppManager.Sender.run(Sender.java:139)
"ClientMessageReceptor840" daemon prio=6 tid=0x2a3ab988 nid=0x6b4 in Object.wait() [0x2f70f000..0x2f70fb1c]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:474)
at org.jacorb.orb.giop.GIOPConnection.waitUntilConnected(GIOPConnection.java:278)
- locked <0x0a6c1bf8> (a java.lang.Object)
at org.jacorb.orb.giop.GIOPConnection.getMessage(GIOPConnection.java:318)
at org.jacorb.orb.giop.GIOPConnection.receiveMessages(GIOPConnection.java:464)
at org.jacorb.orb.giop.MessageReceptor.doWork(MessageReceptor.java:71)
at org.jacorb.util.threadpool.ConsumerTie.run(ConsumerTie.java:61)
at java.lang.Thread.run(Thread.java:595)
Have I miss-interpreted the HotSpot stack trace?

To summarise they are both in a synchronized block on the same mutex/Object, but one is in a wait and one isn't.
So then it follows that if the HotSpot thread reads " - waiting on <address>" like:
"SomeThread" daemon prio=6 tid=0x29a06658 nid=0xf28 in Object.wait() [0x2b18f000..0x2b18fa1c]
at java.lang.Object.wait(Native Method)
- waiting on <address> (a javax.swing.TimerQueue)
at com.comp.SomeThread.run(TimerQueue.java:236)
- locked <0x09539510> (a javax.swing.TimerQueue)
at java.lang.Thread.run(Thread.java:595)
then it means that the thread is trying to enter the synchronized block on the same mutex/Object but it can't because there is another thread in there which is running, so it is waiting on the outside of the lock instead of the inside of the lock like "ClientMessageReceptor840".
Ok, I think I get it now. Thanks everyone for your help.

Similar Messages

  • How can multiple files for the same genre be consolidated

    I organize my iTunes files in genre folders for easy access. ITunes creates multiple folders for some genres and allows a single (preferred) genre file for other much larger files. How can I consolidate multiple files with the same genre?

    Thanks. I've done what you selected. The problem is that despite all files being identified with the same genre, iTunes groups some genres in two separate folders. Thus, I have two "Country" folders, for example. More perplexing is that iTunes groups my largest genre folder, "Jazz", in a single folder.

  • Can multiple threads share the same cursor in berkeley db java edition?

    We use berkeley db to store our path computation results. We now have two threads which need to retrieve records from database. Specifically, the first thread accesses the database from the very beginning and read a certain number of records. Then, the second thread needs to access the database and read the rest records starting from the position where the cursor stops in the first thread. But, now, I cannot let these two threads share the same cursor. So, I have to open the database separately in two threads and use individual cursor for each thread. This means I have to in the second thread let the cursor skip the first certain number of records and then read the rest records. However, in this way, it is a waste of time letting the second thread skip a certain of records. It will be ideal for us that the second thread can start reading the record just from the place where the first thread stops. Actually, I have tried using transactional cursor and wanted to let the two threads share the same transactional cursor. But it seems that this didn't work.
    Can anyone give any suggestion? Thank you so much!
    sgao

    If your question is really about using the BDB Java Edition product please post to the JE forum:
    Berkeley DB Java Edition
    If your question is about using the Java API of the BDB (C-based) product, then this is the correct forum.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How can multiple users manage the same forms?

    We are looking to purchase FormsCenral however after read this FAQ on teams we are confused:
    http://forums.adobe.com/docs/DOC-2903#Q3
    How do we manage forms if more than one user needs to make changes to the same forms?

    You would have a primary user/e-mail address attached to your FormsCentral account, and you can assign multiple co-authors to any of your forms. They would need to each have a free Adobe ID.
    I work in a Higher Education setting, and have co-workers and Graduate Assistants who are co-authors on forms I've produced, so they can each edit and/or view the submitted response tables.
    I hope that helps,
    Brian

  • How can multiple computers have the same library?

    My family has one iTunes account, but our iTunes library is different on every computer. Our iPods are each synced with a different computer. How can we have one library with all of our purchases together? We use the same account, so it doesn't make sense that the music purchased on my laptop won't show up on our home desktop. Each of our iPods are synced to a different computer.

    No.
    Iphone will sync with one and only one computer a a time.  Syncing to another will erase the current content from the iphone and replace with content from the new computer.

  • How can multiple users use the same Creative Cloud Individual on one single-machine?

    We have one shared graphics workstation, which is infrequently in use by different people - therefore we bought a single-workstation license (which we were referred to "Creative Cloud Individual"). In the FAQs it says it installs locally, but whenever a user different from the installing adminstrator logs in, he is forced to use the trial.
    Is there a way to make the local installation usable on that single machine for multiple users?
    Thanks in advance for your reply

    Serenatasystems do the other users not have administrator access?  What happens if they sign in using the Adobe ID tied to your Creative Cloud subscription?  Do your Adobe Creative applications then exit trial mode?

  • Can I combine multiple threads from the same contact in iMessage?

    iMessage displays multiple threads for the same contact.  Its very confusing and has resulted in lost messages.  I've tried changing a number of settings but to no avail.  Seems to require everyone in my contact list to eliminate all their email addresses in iMessage.
    Begs the question why does iMessage even need this information?  Worse, why does it suck it into its settings by default.  The directory server should only require a valid Apple ID (associated with the users' devices)  in order to direct an iMessage between two contacts.

    Thanks for the reply, appreciate your input.  I did find another way of doing it and that is to highlight the first e-mail, hold down the shift key and click on the last one.  That highlights them all and then they can all be deleted.  Your ideas also work of course and I thank you for that.  Cheers.

  • Hi. I purchased a new ipad mini and my brother already has iphone 4,so how can i avoid sharing the same contents that are on his phone? Will creating an other apple id help us in seperating our facetime and icloud accounts as we share our laptop to sync ?

    Hi. I purchased a new ipad mini and my brother already has iphone 4,so how can i avoid sharing the same contents that are on his phone? Will creating an other apple id help us in seperating our facetime and icloud accounts as we share our laptop to sync ?

    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • How can I save to the same map every time when printing pdfs?

    How can I save to the same map every time when printing pdfs?
    Finder points to the document map even when I chose a different map recently.
    I often print series of pdfs from the print dialog box, I'd like to choose the map to save to and then have all subsequent pdf prints automatically directed to the same map until I decide otherwise.

    that link seems to be broken right now:
    403 Error - Forbidden  - No cred, dude.

  • I have itunes on a mac with 2 users but the library only shows on the main user how can both users have the same library?

    i have itunes on a mac with 2 users but the library only shows on the main user how can both users have the same library?

    Hi,
    Have a Look at these Links on Home Sharing:
    http://support.apple.com/kb/HT4620
    http://support.apple.com/kb/HT3819
    Could be what you need...
    Cheers,

  • HT1338 i have apps to be updated but when i try to update them a message pops out saying "You have updates for other accounts, please sigh in with the other id". Can some one help me how can i still update the same with the new apple id ive created.

    i have apps to be updated but when i try to update them a message pops out saying "You have updates for other accounts, please sigh in with the other id". Can some one help me how can i still update the same with the new apple id ive created. As i dont have the access to the earlier id anymore.

    You cannot. The apps are assigned to that Apple ID and there is nothing you can do to change that. You could choose to download them again with the new Apple ID, any paid apps will need to be purchased again.
    Hope that helps.

  • HT5177 How can two people edit the same FCPX file? One company, so both people/computers share the same license. Example: I work on revision A and my boss takes it and makes revision B and gives it back to me using two separate computers.

    How can two people edit the same FCPX file? One company, so both people/computers share the same license. Example: I work on revision A and my boss takes it and makes revision B and gives it back to me using two separate computers.

    Have the project, events and media on one drive which is common to both macs.
    You can download FCP X to both macs using the same Apple ID that it was purchased with.
    Andy

  • HT204053 Can multiple people use the same Apple ID for their own devices?

    Can multiple people use the same Apple ID for their own devices? I just set up my IPhone 4S (first time user) using the same Apple ID as my daughters and now we receive each others texts, do I need to set up my own Apple ID account?

    Yes, you can.  In fact it's recommended that you use different IDs for iMessage, FaceTime and iCloud.  You can still share the same ID for iTunes without any issues.
    You are getting each other's text messages because you're using the same ID for iMessage.  To fix this, one of you should go to Settings>Messages>Send & Receive, tap the ID, sign out, then sign in with a different ID.  To avoid getting each other's FaceTime calls, do the same thing in Settings>FaceTime.

  • I can not join my Apple extreme with the Apple express. I shows a conflict in the network! I've tried everything. How can they join on the same network?

    I can not join my Apple extreme with the Apple express. I shows a conflict in the network! I've tried everything. How can they join on the same network?

    It says that my DHCP has to be changed! How? to what?
    It is 802.11g.express. but is set to default by the computer (Macbook Air).
    The other is 802.11n. (express)
    Extreme is 802.11.g. Is the Main Airport.
    It is on ethernet & wep 128 security.

  • How can I return to the same position in the calling order details form

    I am Calling a form for creating a new item from order details form, so after creating The new item I want to returned the item code to the calling form to same position in The order details form , how can I return to the same position in the order details form
    Waiting for your valuable answer .
    Best regards
    Jamil Alshaibani

    Dear Friends
    My actual problem description as the following
    I have a form for production order screen , and this form contain header and details blocks , so the user in the details will select Type Code , and he will go the next field that is Item Code Field search for specific Item Code if it is not exist he has to call the Item Definition Form by using this script
    CALL_FORM(ITEM_DEFINITION);
    Then when he finished defining the Item , and I assign the item code as the following in the :
    WHEN-BUTTON-PRESSED TRIGGER
    :GLOBAL.ITEM_CODE_VAR := :ITEM_CODE;
    DO_KEY('exit_form');
    But I don't know where to keep this assignment
    :ITEM_CODE := :GLOBAL.ITEM_CODE_VAR;
    inside the caller form in which trigger do I have to use when it return from the caller form it should assign the :GLOBAL.ITEM_CODE_VAR to the :ITEM_CODE and the cursor it should show inside the ITEM_CODE , and as I mention it does not return to the same location of The ITEM_CODE when it return from the calling form
    Waiting for your valuable answer .
    With example please .
    Best Regards
    Jamil Alshaibani

Maybe you are looking for

  • TS3258 I get error message -42408 when trying to download itunes update 11.0.2 and thus can not upgrade to latest version.  What should I do?

    I get error message -42408 when trying to download itunes update 11.0.2 and I therefore can not update to that latest version.  What can I do?

  • Cannot change tab in webhelp

    Since my company is changing some of its product names, I need to change my webhelp accordingly. I changed the project name for one of the help projects, but the webhelp tab label in the Online Help stays the same. I used the search function in the W

  • Why can't we view Java on the iphone?

    Why can't we view java. I understand that Steve Jobs said in 2010 that it was a dying technology however lots and lots of sites still use it and I am tired of needing my laptop every time I want to use one of those sites. This includes large companie

  • Find out what Apple ID was used to install an app

    I've passed an iPad on to my boss and it seems I've left an app on there that keeps asking for my personal Apple ID for update purposes. Of course he's only come to me with this question when he's gone to do an update because there's 20 apps in the q

  • Alt Tags on slide shows

    Im trying to attach some Alt Tags to a sliding image but not sure how to go about it. <script type="text/javascript"> var fadeimages=new Array() //SET IMAGE PATHS. Extend or contract array as needed fadeimages[0]=["images/template1web.jpg", "", ""] f