Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
What is difference between synchronous and asynchronous exception handling?
can someone help me for understanding this fact??
2 Respostas
+ 1
hi Deepak,
Exception handling is designed to support only synchronous exceptions, such as array range checks.
The termĀ synchronous exceptionĀ means that exceptions can be originated only fromĀ throwĀ expressions.
The C++ standard supports synchronous exception handling with a termination model.Ā
TerminationĀ means that once an exception is thrown, control never returns to the throw point.
Exception handling is not designed to directly handle asynchronous exceptions such as keyboard interrupts.
However, you can make exception handling work in the presence of asynchronous events if you are careful.
For instance, to make exception handling work with signals, you can write a signal handler that sets a global variable, and create another routine that polls the value of that variable at regular intervals and throws an exception when the value changes. You cannot throw an exception from a signal handler.
0
thank you