public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: ljrittle@gcc.gnu.org
To: andrew@andypo.net, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
	ljrittle@gcc.gnu.org, rodrigc@gcc.gnu.org
Subject: Re: libstdc++/5432: Implementation still not thread-safe on multiprocessor machines
Date: Thu, 24 Jan 2002 13:26:00 -0000	[thread overview]
Message-ID: <20020124212600.20158.qmail@sources.redhat.com> (raw)

Synopsis: Implementation still not thread-safe on multiprocessor machines

State-Changed-From-To: analyzed->feedback
State-Changed-By: ljrittle
State-Changed-When: Thu Jan 24 13:25:59 2002
State-Changed-Why:
    Andrew, there were two minor issues with your patch:
    (And it took collective thought to figure all this out
    so don't feel bad. ;-)
    
    In general, static _Atomic_word should always be init'd
    to 0 with C++.  We think g++ follows the init order
    rules of C which are tighter than C++ but for C++
    non-zero static values may not be init'd until after main()
    has run (the only rule says it must be done "before
    the related block [scope] is entered" which might be after
    threads were started).
    
    Secondly:
    
    <       if (--_M_references == 0)  // XXX MT
    ---
    >       if (__exchange_and_add(&_M_references, -1) == 1)
    
    is correct (you had == 0).  I.e. assuming it was correct
    as written (other than thread-safety) your rewrite had a
    memory leak.
    
    Other than that, Nathan and I have reviewed the patch;
    I have tested it and installed it (that report to
    the libstdc++ mailing list).  To be closed after you
    confirm MP *-*-linux* system fixed as installed and
    then I move it to 3.0.X branch.  Thanks, Loren

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5432


             reply	other threads:[~2002-01-24 21:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-24 13:26 ljrittle [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-02-18 15:46 Andrew Pollard
2002-02-17 18:54 rodrigc
2002-01-23 23:49 ljrittle
2002-01-19  7:26 andrew

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=20020124212600.20158.qmail@sources.redhat.com \
    --to=ljrittle@gcc.gnu.org \
    --cc=andrew@andypo.net \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=rodrigc@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: link
Be 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).