On 9/25/07, Marcus <[EMAIL PROTECTED]> wrote:
>
> Hi Josh,
>
> I agree with your comment. Add synchronization to "add" method is a good
> practice.
>
> Marcus
>

Synchronizing "add" won't solve the problem. Any time you are going to
structurally change the list then any iterator becomes invalid and will
fail-fast by throwing an exception.

Check out the java5 concurrent package for some thread safe data structures
http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/package-summary.html

-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Reply via email to