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 threadsafeon Solaris/Sparc
- From: Stuart Brown <sbrown at inforonics dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 24 Jun 2002 07:30:44 -0400 (EDT)
- Subject: Re: libstdc++/5037: Multithreaded read access to strings not threadsafeon Solaris/Sparc
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
Stuart Brown
sbrown@inforonics.com