• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Quick Collections.synchronizedList question

 
Ciaran Cahill
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi just a quick question about Collections.synchronizedList and synchronizedMap:

Is it necessary to use this for the main lists you might have in your database (like the main list of records or the list of locked records) if you always synchronize before using them?
E.g. for my main list of records I have a corresponding Lock that guards it and which must be acquired before modifying it (design rule). This should guarantee that the list will not be modified by more than one thread at once - or is there a need for a synchronizedList? Just to make sure
thanks
 
Johan den Boer
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have used the same technique. Works great with synchronized map. I do
my locking per record.

Johan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic