When and which approach to use?
Is there any reason to use asynchronous methods, if for synchronous is dedicated separate thread?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You use the asynchronous method to prevent blocking the calling thread. Also, it is preferable to use this approach as opposed to creating your own dedicated thread that will use the sync method. This is .NET general-purpose advice, better to let .NET do the async work, than to create your own dedicated threads.
EDIT: Here is one question that might be of interest to you regarding MSMQ and EndReceive, which is part of the asynchronous model for MSMQ in .NET.