Win a copy of Spark in Action this week in the Open Source Projects 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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).]
 
I am Arthur, King of the Britons. And this is a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic