aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Bodgitt & Scarper 2.2.3 (Locking & Unlocking) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Bodgitt & Scarper 2.2.3 (Locking & Unlocking) " Watch "Bodgitt & Scarper 2.2.3 (Locking & Unlocking) " New topic
Author

Bodgitt & Scarper 2.2.3 (Locking & Unlocking)

satishkumar janakiraman
Ranch Hand

Joined: May 03, 2004
Posts: 334
Hi,

I have used conventional Synchronization technique for my locking in my assignment. I used Roberto's tool for verifying my locking and it is running normally but with RecordNotFoundException . I think this behaviour is normal and expected

Does it mean my locking strategy work fine? My requirement says

Any attempt to lock a resource that is already locked should cause the current thread to give up the CPU, consuming no CPU cycles until the desired resource becomes available.

To meet this requirement, I use wait() in lock method and also use notifyAll in unlock method. Does it sound good ? or Am I doing something different? Is there any solution to verify the above requirement?

PS: Thanks to Roberto's for his tool. It's

sat

Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2267
    
    3

Howdy, Sat!

It looks like everything's fine, champion. Just remember that the locking mechanism must work in standalone mode and in networked mode.

PS: Thanks to Roberto's for his tool. It's


You are very welcome, my friend!


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
satishkumar janakiraman
Ranch Hand

Joined: May 03, 2004
Posts: 334
Hi Roberto,

Thanks for your reminder. Its working as expected in both modes.
sat
 
wood burning stoves
 
subject: Bodgitt & Scarper 2.2.3 (Locking & Unlocking)