MT-safe string, part 1
Benjamin Kosnik
bkoz@cygnus.com
Sat Apr 1 00:00:00 GMT 2000
> Attached below are diffs for the essentials of MT-safe basic_string<>.
thanx daddyo
> What is missing is the #include and the configure script apparatus to
> choose the right include file to declare (and define) the primitives
> used. (The corresponding apparatus in Glibc refers to
> sysdeps/*/atomicity.h. For some reason the x86 (x >= 4) version of
> that file, as posted here earlier, is not there.)
yeah we should probably pull in the sysdeps/(arch)/atomicity headers.
They define primitives for alpha/arm/hppa/mips/powerpc/sparc. And
variants. No sense duplicating code..
> Note that for most uses on Linux, just substituting different header
> includes is _not_ sufficient. Most distributions are built for a "386"
> target, which lacks the appropriate instructions. (SPARC-1 and HPPA,
> I gather, also lack appropriate instructions, so MT on them will be
> miserable.) Linking an alternatively-compiled version of the library,
> a common adaptation, wouldn't be enough, because these are inline
> operations which affect non-library object files.
there are i386/i486/i586/i686/i786 dirs, but an atomicity only in i486.
We can do it for i486 or above, forget about the rest.
or put in stubs, like sysdeps/generic
> If someone can point me at the right place to hack the apparatus in,
> and/or an example of similar things done, I can do more of the job.
the glibc stuff? you can look at the autoconf hackery in acinclude.m4,
say GLIBCPP_CHECK_CTYPE. I'll look at this tomorrow.
-benjamin
More information about the Libstdc++
mailing list