From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7638 invoked by alias); 9 Aug 2002 06:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 7624 invoked by uid 71); 9 Aug 2002 06:26:01 -0000 Date: Fri, 09 Aug 2002 02:26:00 -0000 Message-ID: <20020809062601.7623.qmail@sources.redhat.com> To: ljrittle@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Benjamin Kosnik Subject: Re: libstdc++/7445: poor performance of std::locale::classic() in multi-threaded applications Reply-To: Benjamin Kosnik X-SW-Source: 2002-08/txt/msg00180.txt.bz2 List-Id: The following reply was made to PR libstdc++/7445; it has been noted by GNATS. From: Benjamin Kosnik To: Loren James Rittle Cc: bkoz@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, ljrittle@gcc.gnu.org, shurik@sequoiap.com Subject: Re: libstdc++/7445: poor performance of std::locale::classic() in multi-threaded applications Date: Thu, 8 Aug 2002 23:18:57 -0700 > OK, I'd be happy to find a performance fix that doesn't make the > library code subtly less portable when we have a test case. A > reference to code already in our test suite would be acceptable. Yeah. This is kind of all hand-wavy at this point. > Benjamin (as the "local locale" expert), is it *always* true that > std::locale::classic() is called at least once during startup before > control is transferred to main()? If so (and will always be so), then > all thread-related locking could be removed IMHO. In practice, our > implementation of the Standard C++ library (with optional threading > support) already supposes that no thread which uses the library > implementation may have ever been started before main() is invoked. > If not true, then this change would make a very hard to detect > threading bug when the assumption changes. This is true. I would think the lock could then be removed? I'll let you figure out what to do with current sources. Thanks for the help. -benjamin