Comparing Synchronous and Asynchronous Behavior

Synchronous code executes in the order in which it occurs in the compiled program. Asynchronous code executes out of order. When an asynchronous call occurs, the call is made to the asynchronous invoke method and immediately returns. The flow of execution resumes while the asynchronous process finishes separately. You can write code to block until the asynchronous process finishes, or you can pass a callback method to the asynchronous process so it will notify you by invoking the callback when the data is ready.

The GcdDemo.sln file demonstrates code that determines the greatest common divisor of two numbers. The sample application calculates the greatest common divisor using recursion, demonstrating ...

Get Visual Basic® .NET Power Coding now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.