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: notes on current atomics config and usage


Paolo Carlini wrote:

Mark Mitchell wrote:

Paolo Carlini wrote:

In fact, ideally, from the library point of view, we would like to
*inline* in the headers the builtin atomics and the user should not be
allowed to pass -march=i386 and obtain unresolved symbols at link time
too easily!

I'm not sure what you mean by this; if you use the intrinsics, then the compiler will do the inlining for you? But, I think the headers should still permit compilation with -march=i386; there should be a macro to check, and libstdc++ should check it. :-)

As pointed out be Benjamin yesterday, there is a problem of consistency between the atomics used inside in the library and those used in the headers. If the user passes -march=i386 and doesn't want unresolved symbols at link time the only ways are: 1- Inline the mutexes, or, 2- Call mutexes inside the library.

Point 2- is not well stated, sorry. Indeed, user code compiled with -march=i386 could well call into the library and find atomics implemented with builtins, and everything would work fine, if done consistently, *but* we would *not* inline, and that was the initial issue.


Paolo.


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