• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Locking question

 
Sean Beecroft
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently using a single Reentrant lock. This is less efficient. I am contemplating re-writing my locking so that it has multiple locks. Has anyone gotten 80/80 with a single Reentrant lock? Will I get punished?

It seems to be a delicate balance between over engineering and under engineering.
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Sean,

I had 2 locks: one for the database file and one for the HashMap with the locked records. (and I got 80/80 for that).

I don't think that effiency is really an issue here: as long as you can explain your decisions.

Herman
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic