37 ms·
Took a glance, it seemed the author took exception handling as simple as try {} catch{} and thus never discuss OS' role in exception handling. But one of the m
by mrjin 4y ago
Took a glance, it seemed the author took exception handling as simple as try {} catch{} and thus never discuss OS' role in exception handling.
But one of the most expensive part in user mode exception handling is context switches between user mode and kernel mode.
- pjc50 4y agoIs that incurred for user-initiated exceptions (not traps or Windows "SEH")? In which implementations?
- ishitatsuyuki 4y agoIt 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/12/13/cxx-exception-unwinding.html http://stffrdhrn.github.io/software/toolchain/openrisc/2020/....
- tsimionescu 4y agoAre you referring to interrupts by any chance? The OS has nothing whatsoever to do with C++ exceptions in user-mode code.
- bregma 4y agoUsermode exception handling performs no system calls. Perhaps you're thinking of user handling of system exceptions on Windows, which are pretty much unrelated to C++ exceptions?