• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

collection-synchronizeList

 
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
If i need synchonize List then which one is better, vector or Collection.synchonizeList(new ArrayList) and why.
Thanks and Regards,
kundan
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kundan

Truly, I dont see any difference. synchronized arraylist = vector.

Though not 100% sure. Let see if someone thinks otherwise.

Cheers
 
Marshal
Posts: 76888
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I dont see any difference

There isn't a lot of difference but nowadays most people would use an synchronized ArrayList.
 
Ranch Hand
Posts: 1170
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vector is all but deprecated. Nobody uses it anymore unless they are being a rebel

This goes for Hashtable and other collections created at that time. Basically there is rarely a need for a pre-synchronized collection. Its rare that you have multiple threads that only wish to add or remove something from a collection. Typically they do something else even if very slight. So the synchronization on those collections is typically wasted.
[ June 26, 2006: Message edited by: Mr. C Lamont Gilbert ]
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic