public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Loren James Rittle <rittle@latour.rsch.comm.mot.com> To: ljrittle@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: libstdc++/7445: poor performance of std::locale::classic() in multi-threaded applications Date: Thu, 08 Aug 2002 23:26:00 -0000 [thread overview] Message-ID: <20020809000600.22893.qmail@sources.redhat.com> (raw) The following reply was made to PR libstdc++/7445; it has been noted by GNATS. From: Loren James Rittle <rittle@latour.rsch.comm.mot.com> To: 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 Cc: Subject: Re: libstdc++/7445: poor performance of std::locale::classic() in multi-threaded applications Date: Thu, 8 Aug 2002 18:58:42 -0500 (CDT) 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. I just looked at some locale code in our test suite under gdb and then constructed the smallest cases that used std::locale::classic() [1] and another that did not [2]. Then, I compiled both [1] and [2] with and without -static and looked under gdb. In all four cases, std::locale::classic() was called once before main(). [1] #include <locale> int main (void) { std::locale::classic(); } [2] #include <locale> int main (void) { } 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. Regards, Loren
next reply other threads:[~2002-08-09 0:06 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-08-08 23:26 Loren James Rittle [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-11-19 18:31 ljrittle 2002-11-19 18:27 bkoz 2002-11-19 18:16 Alex Kompel 2002-11-19 12:46 Benjamin Kosnik 2002-11-19 12:46 Alex Kompel 2002-11-19 12:31 bkoz 2002-08-09 2:26 Benjamin Kosnik 2002-08-08 17:06 bkoz 2002-08-02 9:25 bkoz 2002-07-31 12:35 bkoz 2002-07-30 11:46 shurik
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020809000600.22893.qmail@sources.redhat.com \ --to=rittle@latour.rsch.comm.mot.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=ljrittle@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).