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 01:43:02AM -0500, Phil Edwards wrote:
> On Tue, Nov 05, 2002 at 12:11:56AM -0500, Phil Edwards wrote:
> > Fixing generic/atomicity.h is something that I should have done some time
> > ago.  Mea dorkus culpa, where does the time go.
> 
> Done, patch below.  Richard Earnshaw provided a patch
> 
>     http://gcc.gnu.org/ml/libstdc++/2002-10/msg00031.html
> 
> that was simpler than what I had done, so I took his code and made some
> changes.
> ... 
> This is the only atomicity.h which needs to declare a variable at all.
> I believe the best place for such things is in the __gnu_cxx namespace,
> rather than at the global level.  Any reasons not to do so?
> 
> I don't believe there are any PRs directly associated with
> generic/atomicity.h.

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.  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.

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

Nathan Myers
ncm@cantrip.org


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