empty-string refcount contention

Martin Sebor sebor@roguewave.com
Wed Apr 2 20:14:00 GMT 2003


Nathan Myers wrote:
> On Mon, Mar 31, 2003 at 04:31:35PM -0600, Benjamin Kosnik wrote:
...
> This seems like a good bet, but I wonder whether, in a shared library,
> getting the address of the empty _Rep object itself involves looking
> up a relocation, and thus itself requires a bus cycle?  (If so, at 
> least it's not volatile, thus cacheable.)  Is there any way to ensure 
> that the address of the empty _Rep object is entirely inlineable, so 
> that address comparisons don't require a bus cycle?

Intersting. I don't know the answer to this (I didn't even think
about it), but it occurs to me that making sure that the object
is not defined in the shared library (but instead in the executable,
which may be a third party shared library, that links with it) might
eliminate this potential problem.

Martin



More information about the Libstdc++ mailing list