Make generic atomicity.h use gthr.h mutexes

Phil Edwards phil@jaj.com
Thu Nov 7 11:21:00 GMT 2002


On Thu, Nov 07, 2002 at 05:37:13PM +0000, Nathan Myers wrote:
> I have strong doubts about this approach.  The library would pass tests
> but the performance would be prohibitively bad.  It would be better to 
> refuse to build, under configure options implying threading and no
> instruction-level atomicity is available, than to pretend.

We wouldn't be pretending; the operations are atomic from an outsider's
point of view.  Not at the instruction level, but still correct.


> I wouldn't
> object to additional configure option, e.g. --very-slow-threadsafe-string
> and --thread-unsafe-string to be used to make it build anyway.

Dunno about options (and it's very possible that atomicity.h will get used
outside of the string class).  I'd recommend at least a configure test,
if threads are enabled but the generic model is used, to print a warning
saying that these operations will be slow.

(How slow are we talking?  Give me a test case, I'll run it with both
models.  I don't think these functions are called that often.)


> I agree that quietly building something broken, as we do now, might be worse.

/Might/?


Phil

-- 
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
                                                 - Edsger Dijkstra, 1930-2002



More information about the Libstdc++ mailing list