Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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

Hashtable vs Hashmap for Locking

 
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 ?
 
author
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
 
Ranch Hand
Posts: 1871
  • 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).]
 
Attractive, successful people love this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic