This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Make generic atomicity.h use gthr.h mutexes


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]