Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 26878 invoked from network); 10 Apr 2002 09:54:02 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 10 Apr 2002 09:54:02 -0000 Received: (qmail 27545 invoked by uid 97); 10 Apr 2002 09:54:13 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 27508 invoked by uid 97); 10 Apr 2002 09:54:12 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 27497 invoked from network); 10 Apr 2002 09:54:12 -0000 User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.0.3 Date: Wed, 10 Apr 2002 10:53:14 +0100 Subject: Re: FastArrayList, FastHashMap, FastTreeMap not thread safe From: Janek Bogucki To: Jakarta Commons Developers List Message-ID: In-Reply-To: <3CB3FF5D.D0591018@dlr.de> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, > From: Christoph Reck > Organization: DFD-DLR > Reply-To: "Jakarta Commons Developers List" > Date: Wed, 10 Apr 2002 11:01:17 +0200 > To: Jakarta Commons Developers List > Subject: Re: FastArrayList, FastHashMap, FastTreeMap not thread safe > > Paul, the contract of the Fast* collections is to be usable > within *one* thread or in a context where a sychronisation > is done outside by an encapsualting owner class. That is > the reason for allowing it to be fast. This was discussed > in the thrads at the time where these collections found > their way in. > > Fast* designers please correct me if I'm wrong (I'm just > recollecting this from my memory - which is near to overflowing > with some threads here...;). > > :) Christoph > This description is from http://jakarta.apache.org/commons/collections/api/org/apache/commons/collect ions/FastHashMap.html public class FastHashMap extends HashMap A customized implementation of java.util.HashMap designed to operate in a multithreaded environment where the large majority of method calls are read-only, instead of structural changes. When operating in "fast" mode, read calls are non-synchronized and write calls perform the following steps: Clone the existing collection Perform the modification on the clone Replace the existing collection with the (modified) clone When first created, objects of this class default to "slow" mode, where all accesses of any type are synchronized but no cloning takes place. This is appropriate for initially populating the collection, followed by a switch to "fast" mode (by calling setFast(true)) after initialization is complete. NOTE: If you are creating and accessing a HashMap only within a single thread, you should use java.util.HashMap directly (with no synchronization), for maximum performance. Version: $Revision: 1.1 $ $Date: 2001/08/17 23:26:28 $ -Janek -- To unsubscribe, e-mail: For additional commands, e-mail: