[cpp-threads] Issue 1369 --- thread safety of std::rethrow_exception

Howard Hinnant howard.hinnant at gmail.com
Mon Nov 15 16:21:09 GMT 2010


On Nov 15, 2010, at 10:55 AM, Anthony Williams wrote:

> I appreciate that if the data is not present in code compiled to the C++03 ABI then C++0x code can only depend on C++0x code. However, can't the ABI be made backwards compatible, so it remains compatible with the C++03 ABI **and** is compatible with the new C++0x ABI? This would avoid "doubling the size of the OS". Of course, it depends on the details.

To make this change, I would need to see an implemented backwards-compatible Itanium ABI which successfully passed through review at cxx-abi-dev at codesourcery.com.  I have not personally come up with a design which I thought would be implementable and pass such a review.

This process would have to happen well before the end of 2010 to give implementors and vendors sufficient time to implement/review such changes for their own platforms prior to Feb. 25, 2011 (the pre-Madrid mailing deadline).  Even this schedule seems overly optimistic to me for such a large change.  But I admit it may be within the realm of possibility if we get enough people to work straight through the holiday season.

> 
>> I do not believe that this is a migration strategy that many
>> platforms are going to buy into.
>> 
>> If platforms do not have a practical migration strategy, then they
>> are just not going to migrate.  And then you've got another export.
> 
> Is there nothing else in C++0x that breaks the ABI? There are certainly a lot of language facilities that are not in C++03. Is Apple going to oppose any change that breaks the ABI?

Apple currently has a migration strategy:  For all "high level" parts of C++0x, we will version the ABI using inline namespaces.  This allows for separate C++03 and C++0x ABI's to be shipped on the same OS and the only doubling is in the OS-supplied dyld of the std::lib (we will ship C++03 and C++0x std::libs). Applications and dyld's can migrate or not.  If two dyld's using the different ABI's are used in the same application, they will either work (because they share the same ABI, or they do not expose ABI-versioned std::lib components in their interface), or they will fail at link time.  std::string is an obvious example that will be ABI-incompatible (ABI-versioned) between C++03 and C++0x.

However "low level" parts of the std::lib are not versioned, and will be ABI compatible across C++03 and C++0x.  These low level parts include operator new/delete, so that memory allocated from the C++03 std::lib can be deallocated by the C++0x lib, and vice-versa.  And exception throwing/catching is also ABI compatible across the C++03 and C++0x.  This is done so that an application can link to dyld1 and dyld2, and not have to care which std::lib its dyld's are using.  As exceptions bubble up from the dyld's, the application does not need to concern itself if these are C++03 or C++0x exceptions.  Even the std-defined exception classes are ABI compatible across C++03 and C++0x.

-Howard




More information about the cpp-threads mailing list