This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: basic_string::release and thread safety: what about basic_string::grab?
- To: egcs at egcs dot cygnus dot com
- Subject: Re: basic_string::release and thread safety: what about basic_string::grab?
- From: Benjamin Kosnik <bkoz at cygnus dot com>
- Date: Tue, 06 Jul 1999 12:56:15 -0700
- Newsgroups: cygnus.egcs
- Organization: Cygnus Solutions
- References: <199907061737.KAA06992@atrus.synopsys.com>
Joe Buck wrote:
> The v2 version of basic_string::Rep::release has been changed to be
> thread-safe on the x86 and sparc platforms by using atomic instructions
> to decrement the reference count. However, basic_string::Rep::grab, which
> increments the reference count, is not protected.
I have a tangential topic related to this, since you've brought it up: how
are these thread-safety issues with string coming to light? Can you post
specific code samples to demonstrate or reproduce them? It would be nice if I
could quickly see where both v-2 and v-3 stood, and since none of the
commercial test suites explicitly test for MT-safe issues, I am left with
this grab-bag of random test cases I've accumulated over the last year.
Thanks,
Benjamin