Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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/....


Are you referring to interrupts by any chance? The OS has nothing whatsoever to do with C++ exceptions in user-mode code.


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?


Is that incurred for user-initiated exceptions (not traps or Windows "SEH")? In which implementations?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: