About Question enthuware.ocpjp.v7.2.1522 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
alex
Posts: 42
Joined: Tue Feb 12, 2013 4:35 pm
Contact:

About Question enthuware.ocpjp.v7.2.1522 :

Post by alex »

I am bit confused about the following sentence.
Thread T1 holds the lock for an object obj. Thread T2 has called obj.wait() and is blocked.

How could it happen?
How could they keep lock on the same obj at the same time? To call obj.wait() T2 have to hold te lock for an obj.

Then answer: Thread T1 releases the lock on obj and calls the notify() method on obj.
How could lock release happen before notify(). It it happens then we will not be able to call notify() without exception.

Please explain this issue.

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1522 :

Post by admin »

You are right. Both the statements should actually be reversed.
This has now been updated.

thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests