.NET Framework 2.0 Performance Inspection Questions - Asynchronous Processing

From Guidance Share

Jump to: navigation, search

- J.D. Meier, Srinath Vasireddy, Ashish Babbar, Rico Mariani, and Alex Mackman

You can use asynchronous calls to help increase application concurrency.

To ensure that you use asynchronous processing appropriately, review the following questions:

  • Do you poll for asynchronous invocation resources?
  • Do you call EndInvoke after calling BeginInvoke?

Do You Poll for Asynchronous Invocation Results?

Avoid polling for asynchronous invocation results. Polling is inefficient and uses precious processor cycles which can be used by other server threads. Use a blocking call instead. Methods of AsyncResult.AsyncWaitHandle.WaitHandle class such as WaitOne, WaitAll, and WaitAny are good examples of blocking calls.

Do You Call EndInvoke After Calling BeginInvoke?

Review your code to see where it calls BeginInvoke to use asynchronous delegates. For each call to BeginInvoke, make sure your code calls EndInvoke to avoid resource leaks.

More Information For more information about the questions and issues raised in this section, see Explained: Asynchronous Calls Explained and .NET 2.0 Performance Guidelines - Asynchronous.

To review your design and how it uses asynchronous processing see Web Application Performance Design Inspection Questions - Concurrency.

Personal tools