-- SCJP 1.4 (98%), SCJD (98%), SCWCD (96%), OCA Dev (97% avg.), SCBCD (97%), SCJP 1.5 BETA (90%)<br />-- OCP Dev (maybe), MCDBA (probably) SCEA (eventually)<br />-- Haven't tried Firefox yet? Free, open, secure, fast, tabified, and slick!<br />-- <a href="http://www.mozilla.org/products/firefox/" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/</a>
I can not figure out how to give up the lock on the LockManager when waiting on the LockObject. If I use a synchronized blocks I will always either have both monitors, or at some point have no monitors. Either situation is bad.
Originally posted by Marcus Beale:
To clarify a little:
I can not figure out how to give up the lock on the LockManager when waiting on the LockObject. If I use a synchronized blocks I will always either have both monitors, or at some point have no monitors. Either situation is bad.
Originally posted by Marcus Beale:
PS. Does anyone know how to edit postings?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Originally posted by Marcus Beale:
The only problem I can see is that the number of lockObj in memory will grow (up to the number of records). I'm thinking the solution would be to every so often remove old/unused lockObj. I haven't figured out how to tell if a lockObj is unused. Does anyone know a way to find out if threads are waiting on an object? I guess you could duplicate the wait information.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
A clear design, such as will be readily understood by junior programmers, will be preferred to a complex one, even if the complex one is a little more efficient.
-- SCJP 1.4 (98%), SCJD (98%), SCWCD (96%), OCA Dev (97% avg.), SCBCD (97%), SCJP 1.5 BETA (90%)<br />-- OCP Dev (maybe), MCDBA (probably) SCEA (eventually)<br />-- Haven't tried Firefox yet? Free, open, secure, fast, tabified, and slick!<br />-- <a href="http://www.mozilla.org/products/firefox/" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/</a>
I am going down to the lab. Do NOT let anyone in. Not even this tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
|