dcsimg
Vector and ArrayList behaviour towards synchronisation
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, August 31, 2006 02:36 AM

As vector is synchronised and ArrayList is unsynchronised.
In case when more than one thread accessing the ArrayList instance will might cause a deadlock situtation , then why we use the arraylist more than a vector.
Plz tell me explaination.

Re: Vector and ArrayList behaviour towards synchronisation

Posted By:   Bill_Pattchen  
Posted On:   Thursday, August 31, 2006 07:29 AM

For performance issues.
Synchronized method are less performant than their unsynchronized counterparts.So, if you don't need thread-safe collection,don't pay the price of synchronization.


Moreover,arrayList is more efficient in terms of data growth.By default, a vector doubles its size while the ArrayList increases its size by 50 percent.

About | Sitemap | Contact