This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: libstdc++/5037: Multithreaded read access to strings not threadsafe on Solaris/Sparc
- From: Nathan Myers <ncm-nospam at cantrip dot org>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 24 Jun 2002 15:10:17 +0000
- Subject: Re: libstdc++/5037: Multithreaded read access to strings not threadsafe on Solaris/Sparc
- References: <Pine.GSO.4.05.10206240728130.17510-100000@uws13.infor.com>
On Mon, Jun 24, 2002 at 07:30:44AM -0400, Stuart Brown wrote:
>
> I am wondering what are the reason(s) for using a spin lock instead of a
> cas instruction on to make the string ref count thread safe on Sparc v9.
> Won't there be contention for this lock ? Sun's technical paper suggests
> that cas is better when the number of threads is greater than the number
> of cpus, which is not uncommon in MT programs. Also, doesn't this
> restrict the usability of the atomicity methods since use in other classes
> could make contention worse ?
>
> here is the sun article
>
> http://soldc.sun.com/articles/stl-new.html
I'm interested in the answer too.
I gather that different SPARC revisions vary in their support
for atomic operations. What revisions are we targeting? More
particularly, have we retired support for those that don't support
the cas instruction?) Certainly the SPARC64 supports all primitives,
and I see that, in fact, its implementation (now) found in
config/cpu/sparc/sparc64/atomicity.h does use the casx instruction.
Nathan Myers
ncm@cantrip.org