News for hackers. Stuff that matters.
Re:The Cost of Exception Handling by mrjin on Saturday November 12, 2022 @04:24AM (#33571528)
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.

Re:The Cost of Exception Handling by pjc50 on Saturday November 12, 2022 @04:53AM (#33571672)
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.
Re:The Cost of Exception Handling by bregma on Saturday November 12, 2022 @07:07AM (#33572319)
Usermode 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?