You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brandon Goodin <ma...@phase.ws> on 2003/04/14 20:46:26 UTC

RE: [OT][THANKS!] ArrayList-Vector-Synchronization

Thanks David. This has clarified a lot for me regarding Collections/Lists
and threading.

Brandon Goodin

-----Original Message-----
From: David Graham [mailto:dgraham1980@hotmail.com]
Sent: Monday, April 14, 2003 12:41 PM
To: struts-user@jakarta.apache.org
Subject: RE: [OT] ArrayList-Vector-Synchronization


>
>So I should create my initial List or Collection using the following
>syntax:
>
>List list = Collections.synchronizedList(new ArrayList());

That is the easiest way.  The alternative is to synchronize on the list
every time you call one of its methods (which is error prone and painful
:-).

David


_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org