• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Bodgitt & Scarper 2.2.3 (Locking & Unlocking)

 
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roberto,

Thanks for your reminder. Its working as expected in both modes.
sat
 
snakes are really good at eating slugs. And you wouldn't think it, but so are tiny ads:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic