• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

assumption about lock/unlock

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on the lock/unlock part right now. I made a assumption about the server: there need only one instance of the Data class running on the RMI server (and might be shared by multiple RMI server threads).
Remember the getRecord() and modify() are all synchronized.
So, for getRecord(int recNum), change returned DataInfo object, modify(DatInfo dataInfo) sequence, the race condition can only occur on the concurrent changing DataInfo object part.
If I am right, I am confused why in the requirement it mentiona a lot about lock, read modify, wrtie, unlock sequence?
Any insights are welcome.
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because multiple clients can connect to that 1 Data class.
I think the famous 'lock/unlock the correct question' mailthread will give you a lot of answers.
Henk van Jaarsveld (NL)
What is that? Is that a mongol hoarde? Can we fend them off with this tiny ad?
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic