aspose file tools
The moose likes Threads and Synchronization and the fly likes HashTable Synchronized Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "HashTable Synchronized" Watch "HashTable Synchronized" New topic
Author

HashTable Synchronized

Yog Ananth
Greenhorn

Joined: Dec 28, 2004
Posts: 27
what is the necessary for all the legacy classes synchronized, any special use for that
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16686
    
  19

By legacy, I am assuming you mean JDK 1.0 container classes.

Good, bad, or indifferent, JDK 1.0 container classes were synchronized to allow threadsafe access. As for why they are still synchronized, I am assuming it is to be backward compatible.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Ed Wallen
Ranch Hand

Joined: Feb 11, 2002
Posts: 34
In general, you should use those objects provided in the new Collections API (since 1.2). If you need a collection implementation to be threadsafe, use the java.util.Collections class. Collections consists exclusively of static methods that operate on or return collections. The methods that begin with "syncronized" will return you a threadsafe collection implementation (list, set, map, etc.).

-Ed
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: HashTable Synchronized
 
Similar Threads
Vector V/s ArrayList
THREAD
synchronized context
Why am I getting NullPointerException?
Blocking I/O using Iterator()