Is that incurred for user-initiated exceptions (not traps or Windows "SEH")? In which implementations?
Re:The Cost of Exception Handling
by ishitatsuyuki on Saturday November 12, 2022 @04:54AM
(#33571676)
It is… not? It simply invokes the unwinder / exception handler, like _Unwind_RaiseException. For normal exceptions, no signals are involved. You can get an idea of what is executed at http://stffrdhrn.github.io/software/toolchain/openrisc/2020/....
Re:The Cost of Exception Handling
by tsimionescu on Saturday November 12, 2022 @04:56AM
(#33571680)
Are you referring to interrupts by any chance? The OS has nothing whatsoever to do with C++ exceptions in user-mode code.
But one of the most expensive part in user mode exception handling is context switches between user mode and kernel mode.