[cxx-abi-dev] ABI modification for exception propagation
Sebastian Redl
sebastian.redl at getdesigned.at
Sat May 31 07:24:50 UTC 2008
Dennis Handly wrote:
>> From: Sebastian Redl <sebastian.redl at getdesigned.at>
>> __cxa_end_catch has modified behaviour:
>> * It locates the most recently caught exception and decrements its handler
>> count.
>>
>
> This now has to be atomic since threaded, right?
> Or is this still local to the thread but the next is atomic?
>
This one is local. The handler count and handler chain are duplicated in
every __cxa_exception and __cxa_dependent_exception, and only one thread
ever uses these fields. The reference count is the only thing that will
be modified from multiple threads with potential concurrency. (And the
exception object, but I think the intent of N2179 is to make that the
programmer's problem.)
All modifications of the referenceCount field must be atomic.
I've thought about providing functions that do the incrementing and
decrementing, but I'm pretty sure this makes no actual difference in
compatibility.
Sebastian
More information about the cxx-abi-dev
mailing list