
Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
> > Hello,
> >
[quoted text clipped - 28 lines]
> I suggest looking into the standard ExecutorService and
> CompletionService classes.
There's nothing wrong with that. The ArrayList can be accessed if it's
final and the Thread/Runnable is an anonymous inner class. It can also
be accessed if the array is a field of the class. It can be passed in
the constructor for a Thread subclass. Many options.
Each thread will have to synchronize on a common object, probably the
ArrayList itself, while working on it. Call join() on each Thread to
block until it completes.

Signature
I don't read Google's spam. Reply with another service.
Daniel Pitts - 08 Feb 2008 15:52 GMT
>>> Hello,
>>>
[quoted text clipped - 33 lines]
> be accessed if the array is a field of the class. It can be passed in
> the constructor for a Thread subclass. Many options.
I didn't say the array wasn't accessible.
> Each thread will have to synchronize on a common object, probably the
> ArrayList itself, while working on it. Call join() on each Thread to
> block until it completes.
That would be the way to do it with his current approach, but I was
suggesting he look into a much cleaner, more efficient, and
easier-to-get-correct solution.

Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>