The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Fast/Slow is the question!!!

Posted by Kishori Sharan on November 25, 2000 at 2:56 PM

You must have read these lines in context of comparing the new Collections in Java v1.3 and old collection Vector in java. Yes, you are right that the most of the methods in vector are synchronized. This makes Vector slower when multiple threads access the vector elements simultaneously. However, to overcome this inherent slowness in Java from collections, Java designer decided to give you a choice ( fast/slow. this time fast by default ) in case you want to use new collection classes which are there in Java2. New collections' methods are not synchronized, but if you want to work with synchrozined collections then you can have it just writing a few extra lines of code.

Thanx
Kishori



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us