Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 24989 invoked from network); 28 Sep 2010 20:19:49 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Sep 2010 20:19:49 -0000 Received: (qmail 20311 invoked by uid 500); 28 Sep 2010 20:19:48 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 20177 invoked by uid 500); 28 Sep 2010 20:19:47 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 20169 invoked by uid 99); 28 Sep 2010 20:19:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Sep 2010 20:19:47 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [68.142.207.64] (HELO web31801.mail.mud.yahoo.com) (68.142.207.64) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 28 Sep 2010 20:19:38 +0000 Received: (qmail 52289 invoked by uid 60001); 28 Sep 2010 20:19:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1285705156; bh=qTtTnzBUOQ9CrfLoCexpPvyUDaptiuaWn3ttwGNndT4=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=uJmcof6mtroPrYjlEIk1+VnrBP+kK/54dU1W5odRNGVuVepexKEyezSXX3yaLhQZxLyOImeYFfcBRiRvO9NXli+HXms/lk8lNC/7usjeE2v5OzWI8qlmdfJZDKNNiWyzo7CVpd8SbVjTJ+STblpk/DUyGS2GTJZDs8taetQE+qA= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=nDJmGgsIX6IRQ0UpLSCaA2qG0PxSjLygK1jDzqIzNWgq8/F7fp1f19jT52ygnJ3yfiMNVQN7bwUdtXjFpOsCiV2PIYyT4wwlS5KGcST+4ZBrQOUfcljmOWyKKiKdMuO6CvZ4bID97uZcFuZsdHUOMyP1uEd8zkaBV449H9XglEY=; Message-ID: <478582.49809.qm@web31801.mail.mud.yahoo.com> X-YMail-OSG: 5jeHim8VM1nDLqkpVzDgXz2wHKofNlb.SBtg.O6S7i7ap9Q OR4IOog5GUIOT8SwUhLBb2ml8xn0FH1mXOQ3s49yx_zHdbp1PPCqpYt7Nu6C nLJgixIO22aLDxwMwzI2Osvpt8ecilReKsRD_UuHVGYWh8chGheXV8s1q_z2 VuLv4nFEm0T.R7y5ARN5NHGnDNPRidKxtN1arUO6V.o301SbqOuC5XOZTV2f 1.vpC_HxoTQb3cfqhOkPojgBZezaLRPhgbZoxqz0vIfq8AIOA1HVXWPwl_JC qZzDr3Mybp83cJKozrvnYwA0JVZuq0Fx46pjD8mj5emVvu_LMXpOqp4wsiGa eHbUlla4mMi1k9hNiN3II Received: from [203.83.248.37] by web31801.mail.mud.yahoo.com via HTTP; Tue, 28 Sep 2010 13:19:16 PDT X-Mailer: YahooMailRC/504.5 YahooMailWebService/0.8.107.284920 References: <238966.15561.qm@web31809.mail.mud.yahoo.com> <858775.69595.qm@web31810.mail.mud.yahoo.com> <4CA23689.5090809@oliver-heger.de> Date: Tue, 28 Sep 2010 13:19:16 -0700 (PDT) From: Siddhartha S Subject: Re: [commons-configuration] About reloading and thread-safety To: Commons Users List Cc: s_siddharth_reddy@yahoo.com In-Reply-To: <4CA23689.5090809@oliver-heger.de> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1628467604-1285705156=:49809" X-Virus-Checked: Checked by ClamAV on apache.org --0-1628467604-1285705156=:49809 Content-Type: text/plain; charset=us-ascii Hi, Thank you for your response. An additional question : "The lock you mention is just for protecting reload operations (i.e. if the file on disk has changed). There is no protection against concurrent updates by multiple threads. " Are there examples in documentation/code that illustrate this? The addProperty method, for example, appears to have a synchronized block. Is it still unsafe to use this method across multiple threads without (explicit, additional) serialization? What am I missing? thanks, -Sidharta S > As per documentation, most of the concrete implementations of the Configuration > interface are not thread-safe when modifications are involved. However, looking > at AbstractFileConfiguration ( >http://svn.apache.org/repos/asf/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractFileConfiguration.java >a > ) and >(http://svn.apache.org/repos/asf/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractHierarchicalFileConfiguration.java) >) > , it appears that access *is* synchronized through a reload lock. Do the > concrete implementations (e.g XMLConfiguration) do something that makes them >non > thread-safe with respect to reloads? The lock you mention is just for protecting reload operations (i.e. if the file on disk has changed). There is no protection against concurrent updates by multiple threads. This is in the responsibility of the developer. Oliver > > > thanks, > -Sidharta S --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org --0-1628467604-1285705156=:49809--