What is difference between synchronous and asynchronous exception handling? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

What is difference between synchronous and asynchronous exception handling?

can someone help me for understanding this fact??

27th Jun 2017, 1:43 PM
Deepak Kumar
Deepak Kumar - avatar
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.
4th Jul 2017, 1:54 PM
Nanda Balakrishnan
0
thank you
5th Jul 2017, 2:49 AM
Deepak Kumar
Deepak Kumar - avatar