Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 16154 invoked from network); 10 Jun 2005 23:33:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Jun 2005 23:33:05 -0000 Received: (qmail 23313 invoked by uid 500); 10 Jun 2005 23:32:56 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 23266 invoked by uid 500); 10 Jun 2005 23:32:55 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 23251 invoked by uid 99); 10 Jun 2005 23:32:55 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of nicolas.deloof@capgemini.com designates 194.3.247.82 as permitted sender) Received: from MXEPAR01.capgemini.com (HELO mxepar01.capgemini.com) (194.3.247.82) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 10 Jun 2005 16:32:53 -0700 Received: from mxipar01.capgemini.com (prvmta2 [194.3.224.82]) by mxepar01.capgemini.com (8.13.3/8.13.3) with ESMTP id j5A7dseZ027853 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 10 Jun 2005 09:39:54 +0200 (MEST) Received: from prvmta2.capgemini.com (localhost [127.0.0.1]) by mxipar01.capgemini.com (8.13.3/8.13.3) with ESMTP id j5A7dsj2010751 for ; Fri, 10 Jun 2005 09:39:54 +0200 (MEST) Received: from pasteur2.capgemini.fr (smtp.capgemini.fr [10.67.1.90]) by prvmta2.capgemini.com (8.13.3/8.13.3) with ESMTP id j5A7dsDg010743 for ; Fri, 10 Jun 2005 09:39:54 +0200 (MEST) Received: from pasteur.capgemini.fr (localhost [127.0.0.1]) by pasteur2.capgemini.fr (8.12.10/8.12.10) with ESMTP id j5A7drY9019674 for ; Fri, 10 Jun 2005 09:39:53 +0200 (MEST) Received: from vasnmail.telecom.capgemini.fr ([10.67.188.21]) by pasteur.capgemini.fr (8.12.10/8.12.10) with SMTP id j5A7dqr7019644 for ; Fri, 10 Jun 2005 09:39:53 +0200 (MEST) Received: from [127.0.0.1] by vasnmail.telecom.capgemini.fr (SMI-8.6/SMI-SVR4) id JAA23962; Fri, 10 Jun 2005 09:40:41 +0200 Message-ID: <42A943C7.7070801@capgemini.fr> Date: Fri, 10 Jun 2005 09:39:51 +0200 From: Nicolas De Loof User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: fr, en MIME-Version: 1.0 To: commons-user@jakarta.apache.org Subject: [collection] can I avoid synchronized using a ReferenceMap ? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 0521-2, 25/05/2005), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello, I'm building an UDP based integration service. Each 'client' sends a query on UDP socket and waits for the response. A thread receives all responses and dispatch to clients. My current implementation uses an object that is used as message CorrelationId. When sending a message, the client adds its messageId object into a shared map. After sending it's message, it does an 'messageId.wait()'. The receive thread lookup the map for received id and calls notifyAll() on the associated messageId Object. The client is unlocked and can process response. I'd like to avoid using a synchronized map, and I've read in commons-collection javadoc about the ReferenceMap. Could it be used for this ? If I've understood how it works, I'm not required to remove my MessageId objects from the map, and they will be removed when garbage collector finalize my MessageId (after the UDP response has been processed). Any suggestion is welcome. Nico. This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org