Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Threads and Synchronization
vector: synchronized data and synchronized method
Joined: Sep 02, 2003
Sep 03, 2004 07:23:00
Vector provides synchronized methods to access data, but vector itself is not synchronized data, and there is a big difference.
I do not see how they are different from a programmer 's viewpoint: since all methods are synchronized, the internal data integrity of a vector is always maintained.
What did I miss?
Joined: Aug 08, 2003
Sep 03, 2004 09:32:00
If you have a reference to an object that is contained by a Vector, you can modify the value of that object in an thread un-safe manner. The synchronization just protects the list so-to-speak not the content.
Mr. C Lamont Gilbert
Joined: Oct 05, 2001
Sep 11, 2004 22:17:00
They have some really strange and confusing ways of wording those questions. I bet they think they are clear too...
subject: vector: synchronized data and synchronized method
vector: synchronized data or synchronized method
Vector vs ArrayList
vector or arrayList
A Vector class is a Threadsafe
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013