× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You are correct, iterating over a List is not thread safe. Most (maybe all I
would have to look to be certain) of the Collections classes are not thread
safe. My point was just because something is not thread safe, does not mean
you can't use it because you're using it in a multi-threaded environment.

That being said, you don't want a create a class that relies on a list as
one of it's global variables. Really to make that class thread safe I should
have created a new Collections.unmodifiableList(List) to be safe, but it was
just an example.

--
James R. Perkins


On Tue, Apr 28, 2009 at 06:36, Walden H. Leverich
<WaldenL@xxxxxxxxxxxxxxx>wrote:

but it's completely thread safe.

um... possibly. But is iterating over the List<String> type thread safe?
I know iterating over Lists in .net is _not_ thread safe, not sure about
Java. So while the StringBuilder part may be thread safe, if another
thread is iterating over that same list (or modifying it) then you're no
longer thread safe.

-Walden

--
Walden H Leverich III
Tech Software
(516) 627-3800 x3051
WaldenL@xxxxxxxxxxxxxxx
http://www.TechSoftInc.com

Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.