Return-Path: X-Original-To: apmail-stdcxx-dev-archive@www.apache.org Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D91C5DC04 for ; Thu, 6 Sep 2012 04:18:28 +0000 (UTC) Received: (qmail 24997 invoked by uid 500); 6 Sep 2012 04:18:28 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 24886 invoked by uid 500); 6 Sep 2012 04:18:27 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 24859 invoked by uid 99); 6 Sep 2012 04:18:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 04:18:26 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of msebor@gmail.com designates 209.85.210.182 as permitted sender) Received: from [209.85.210.182] (HELO mail-iy0-f182.google.com) (209.85.210.182) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 04:18:16 +0000 Received: by iayy25 with SMTP id y25so1678984iay.41 for ; Wed, 05 Sep 2012 21:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Txjf60nlAeJj7YkpqdjPSBAy8y0SaowfWv1aA5gKzRU=; b=Fs9buR83DD0/KMSGRtHOu4dOCPcOdR+dHg9dDG9viiYtXrXj570mNWP5gC6rvb8W5q QXBr4z1nnKlASKepaxLNp8QMLSlhWb+bD4hvqLNQkbfGmYL00bAP5roLB/2b1Ip3ombe +e3JnLeC6e8J6ndqLWyZ5LO/srHEQH4mnZIspUSWQKeZq8EqdQ1tkMpdPj5UZhBlmiyD KFo36/J22HIDYFq3/Wx99eRKfEoa8DGyUh2BOjiRomuJq6R4ewQpUU4UoIwurPYu38+K w2FDyCQ3YV+VwdsjUW5i7cnC9vaz7lWZcIqlZP+Kzm2o6SDcR/uzr72Dc9RkcTfabcjV mkww== Received: by 10.50.182.231 with SMTP id eh7mr20495957igc.42.1346905075924; Wed, 05 Sep 2012 21:17:55 -0700 (PDT) Received: from [192.168.1.104] (c-67-177-207-162.hsd1.co.comcast.net. [67.177.207.162]) by mx.google.com with ESMTPS id y9sm1392504igm.10.2012.09.05.21.17.53 (version=SSLv3 cipher=OTHER); Wed, 05 Sep 2012 21:17:55 -0700 (PDT) Message-ID: <504823CE.2020005@gmail.com> Date: Wed, 05 Sep 2012 22:17:18 -0600 From: Martin Sebor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: Stefan Teleman CC: Apache Standard C++ Library Subject: Re: STDCXX-1056 [was: Re: STDCXX forks] References: <40394653-8FCC-4D04-A108-2C650AF8F95B@hates.ms> <5045E764.9090607@hates.ms> <595887D2-6E42-4BC4-AF69-085AE4BA8A7D@hates.ms> <5046BDC1.3020400@gmail.com> <50476748.9040301@gmail.com> <50479CA6.8010306@hates.ms> <50481097.2080307@gmail.com> <50481DDC.6010906@gmail.com> In-Reply-To: <50481DDC.6010906@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Incidentally, a benchmark that I would expect to be more representative of real programs than the test we've been using is one that creates a small number of named locales up front and then uses each in a loop in each thread (as opposed to creating and destroying it in each iteration and thread). With this setup, the per-object mutex implementation should be much faster than the one with the per-class mutex because of the absence of contention. The test has an option that exercises this setup: --shared-locale Martin On 09/05/2012 09:51 PM, Martin Sebor wrote: > On 09/05/2012 09:03 PM, Stefan Teleman wrote: >> On Wed, Sep 5, 2012 at 10:55 PM, Martin Sebor wrote: >> >>> I suspect the difference is due to the overhead of the repeated >>> initialization and destruction of the per-object mutex in the >>> test. The test repeatedly creates (and discards) named locale >>> objects. >>> >>> The per-class mutex is initialized just once in the process, no >>> matter how many facet objects (how many distinct named locales) >>> the test creates. But the per-object mutex must be created (and >>> destroyed) for each named locale. >> >> Agreed. >> >> But: if the choice is between an implementation which [1] breaks ABI >> and [2] performs 20% worse -- even in contrived test cases -- than >> another implementation [2] which doesn't break ABI, and performs >> better than the first one, why would we even consider the first one? > > Breaking the ABI is not an option (unless we rev the version). > But I'm not sure I understand what you think breaks the ABI. > We don't need to add a new mutex -- we can use the __rw_facet > member for the locking. Or did you mean something else? > > Martin > >> >> --Stefan >> >