Click here to Skip to main content
13,507,984 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


3 bookmarked
Posted 6 Sep 2011

Begin/End Asynchronous Methods vs the New Async Methods

, 6 Sep 2011
Rate this:
Please Sign up or sign in to vote.
An article helping you choose which asynchronous model you should use in your .NET project.

A new asynchronous model was introduced in .NET 3.5sp1 where all methods end with ‘Async’ like Socket.RecieveAsync. I will not give you any code samples, there are several articles out there which show how the new model works. Instead, I’m going to try to help you understand the differences and to select which model you should use for your project.

The benefit with the new model is that it’s a lot more similar to the I/O Completion Ports threading model which exists in Windows (and is used internally for all asynchronous operations in .NET). The idea is that the IO model should create as few objects as possible per operation, compared to the old model where one IAsyncResult object is created per operation.

I haven’t looked at the code (using reflector) for the old model versus the new one, but I bet that the code for the new model is a lot more efficient than the old one since it’s more similar to IOCP.

Which Method Should You Choose Then?

Choose the one that you are most comfortable with (which probably is Begin/End since it’s the model that has existed since day one). It’s more likely that you loose performance instead of gaining if you pick a model that you do not fully understand.

As always: Never optimize something unless it has been proven to be a problem.


This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


About the Author

Founder 1TCompany AB
Sweden Sweden
Skip logfiles, try automated error handling!

I'm one of the founders of codeRR, a .NET service which takes care of everything related to exceptions, so that you can focus on writing code.

blog | twitter

You may also be interested in...


Comments and Discussions

GeneralMy vote of 3 Pin
Marcio_Coelho13-Sep-11 7:18
memberMarcio_Coelho13-Sep-11 7:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180417.1 | Last Updated 6 Sep 2011
Article Copyright 2011 by jgauffin
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid