Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between synchronized list and vector

 
Pavan Rao
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any one tell me difference between synchronized list and vector
 
varungupta ggg
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raja

Difference between Vector and List is

Vector are Thread Safe It means Only one Thread can accec Vector SO it can Hit the Performance.

Whereas List are not Thread Safe so as many thread acess the same at same time.

So High Performance is achived.

So If need to understand our requirement Whther er need thred safe and non thred safe model to store our objects.
 
shivendra tripathi
Ranch Hand
Posts: 263
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Syncronized ArrayList and vector both are syncronized. But probably parformance of ArrayList is better than vector.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vvv ggg - please check your private messages for an administrative matter from JavaRanch.
 
Joanne Neal
Rancher
Pie
Posts: 3742
16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sdg raja wrote:can any one tell me difference between synchronized list and vector


Vector implements the List interface, so Vector is a synchronized List.

shivendra tripathi wrote:Syncronized ArrayList and vector both are syncronized. But probably parformance of ArrayList is better than vector.


On what do you base that ? Both Vector and ArrayList are backed by arrays, so i would expect performance to be pretty similar. But I would be happy to be corrected on this if you have any figures to support your statement.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is helpful...

http://skeletoncoder.blogspot.com/2006/09/java-tutorials-arraylist-or-vector.html
 
Campbell Ritchie
Sheriff
Pie
Posts: 47270
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper Young wrote:vvv ggg - please check your private messages for an administrative matter from JavaRanch.
Same again, please.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic