Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hashtable vs Hashmap for Locking

 
amitplace
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody
I have a doubt regarding choice for Hashtable or synchronized(new Hashmap()) in Locking.
Both have some advantages as well as disadvantages
Hashtable is already synchronized but its a bit slow.
On the other hand Hashmap needs to be synchronized though its very fast.
Pls guide me as which one should i use in FBN project ?
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by amitplace:
I have a doubt regarding choice for Hashtable or synchronized(new Hashmap()) in Locking.
I don't The answer is, as far as I'm concerned, "neither". Look carefully at the algorithms you are going to use when locking and unlocking records and ask yourself: is a pre-synchronized data structure going to do the job, or do you need to do your own synchronization?
- Peter
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
amitplace
Welcome to Javaranch. We follow certain conventions with respect to the User name as given in the document here .
Your user name does not follow these conventions. Please re-register with a name following these conventions.
Thanks.
[This message has been edited by Rahul Mahindrakar (edited August 13, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic