Choosing between synchronous and asynchronous methods is essentially the choice for your application’s streaming model. Since for most applications it is unacceptable to be immune to the user when performing other tasks (for example, when accessing the network, as is the case), you need to provide a way to respond to user input during operation.
The two most common options for this are:
- To make your application multithreaded, which allows it to simultaneously perform several operations.
- Use asynchronous callbacks and handle work in small chunks when responding to a user between processing these fragments
The choice between, for example, Read and BeginRead corresponds to the choice between options 1 and 2 above (I believe that when using locking methods such as Read , you will need to do this in a different thread than the one on which your user interface is running, therefore while technically this is not necessary, in practice, an application that uses blocking calls will be multithreaded).
If you do not quite understand what I'm talking about, use synchronous calls, because it will be easier. You will have the opportunity to revise your approach later if (when) your application starts responding.
source share