🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #681

Re: dynamic arrays

#681
From: Phil Earnhardt
Date: Thu, 18 May 2000 00:00
31 lines
2167 bytes
On Fri, 19 May 2000 00:06:05 +1000, "someguy" <someguy@somewhere.com> wrote:

>what disadvantages do i have with the java.utils.ArrayList
>java.util.LinkedList not being synchronized?

Quoting from _The Java Class Libraries Second Edition, Volume 1
Supplement for the Java 2 Platform_ :

"java.util.ArrayList

Synchronization

The list allows more than one thread to read from it. However, if a thread
wants to modify the list, there should not be any thread reading from it at
the same time. If reads and modifications need to be able to occur
concurrently, you can create a synchronized version of the list by calling
Collections.synchronizedList() on the list. This creates a version of the
list in which all of the methods are synchronized. Note that although each
method might still need to synchronize a sequence of method calls. See the
Collections class description for more details."


Doug Lea, author of _Concurrent Programming in Java_, did much of the
initial work on the collection framework. Providing selectable concurrency
protection is one of the key features in its design.

As an aside, I really like the writeups and examples in the Java Class
Libraries books. If you have this kind of question with any frequency, they
are worthwhile books to have around.

--phil
Technical Details
Message-ID: <8g1cpf$k0o@flatland.dimensional.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <958656104.72811@brs.ihug.com.au> <8g0r6r$hos$1@bugstomper.ihug.com.au> <3923f57c@pfaff.ethz.ch> <958659875.445451@brs.ihug.com.au>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113ae9,2738036dde0b002c
X-Google-Attributes: gid113ae9,public
X-Google-Thread: fdb77,2738036dde0b002c
X-Google-Attributes: gidfdb77,public
X-Google-Thread: 10d6db,2738036dde0b002c
X-Google-Attributes: gid10d6db,public
From: pae@dimensional.com (Phil Earnhardt)
Subject: Re: dynamic arrays
Date: 2000/05/18
Message-ID: <8g1cpf$k0o@flatland.dimensional.com>
X-Deja-AN: 625089572
References: <958656104.72811@brs.ihug.com.au> <8g0r6r$hos$1@bugstomper.ihug.com.au> <3923f57c@pfaff.ethz.ch> <958659875.445451@brs.ihug.com.au>
X-Trace: wormhole.dimensional.com 958674551 206.124.0.24 (Thu, 18 May 2000 12:29:11 MDT)
Organization: Dimensional Communications
NNTP-Posting-Date: Thu, 18 May 2000 12:29:11 MDT
Newsgroups: aus.computers.java,comp.lang.java.advocacy,comp.lang.java.help