We recently discovered the limitation of the C++ runtime regarding exceptions and multithreading, namely that having global exception state makes it incompatible with using exceptions on multiple BIOS threads, and I am looking for a way around this limitation. I have studied the RTS code for exception handling and I believe we could solve the problem ourselves if we had a way to register hook functions that would be called before an exception is thrown (at the beginning of cxa_allocate_exception) and after it is fully handled (at the end of cxa_free_exception). In our application our first hook function would lock a mutex and increase the task priority to maximum, and our second hook would restore the task priority and unlock the mutex. That would prevent two threads from being in a throw/catch sequence at the same time, and the elevated priority would ensure that the exception is handled as quickly as possible (this is a design choice, not necessarily applicable to every application). We might also perform logging or other application-specific things in these hook functions.
This seems like a very simple design change that would still leave the burden of thread safety and testing on us, but it would make a solution possible. What would it take to get this simple enhancement to be able to register hook functions? We could change the RTS code ourselves and rebuild it but we would much prefer to have an official enhancement from TI.