libstdc++/5037: Multithreaded read access to strings not threadsafe on Solaris/Sparc
Nathan Myers
ncm-nospam@cantrip.org
Mon Jun 24 08:10:00 GMT 2002
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
More information about the Libstdc++
mailing list