O'Reilly logo

.NET Common Language Runtime Unleashed by Kevin Burton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Thread and Asynchronous Callback Exceptions

What happens if an exception occurs in another thread of the current AppDomain or in an asynchronous callback? Two samples will illustrate what happens when an exception occurs in an asynchronous callback or in another thread.

Asynchronous Callback Exceptions

At first, you might not consider exceptions in the context of an asynchronous callback. However, when you try it, it seems that there is a bug because it does not seem to work as you planned. Perhaps you were under the false impression that asynchronous callbacks simply use the ThreadPool, and the ThreadPool is a simple collection of Threads. It is more complex than that. The following sample application will help you understand what is happening ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required