The .NET Asynchronous I/O Design Pattern

Asynchronous operations allow a program to perform time consuming tasks on a background thread while the main application continues to execute. For example, consider when a program makes a request to a remote system. In a single-threaded scenario, the call is made and the CPU goes idle as the caller waits on the server's processing time and the network latency. If this waiting time can be delegated to a separate thread of execution, the program can complete other tasks until it receives notification the background work is complete. However, managing multiple threads and cross-thread communication adds complexity to your code. Fortunately, the .NET Framework has a useful design pattern applied to its I/O classes which easily enables asynchronous calls. Let's take a look at an example.
Comments
Advertisements
Zimbio Entertainment
Copyright © 2012 - Zimbio, Inc. Some rights reserved. Coming soon: Livingly
Share
. . .
Follow
. . .