- Sun Jan 30, 2022 11:52 am
#93503
I suspect the question was about asynchronous / synchronous operation of software elements rather than serial communication.
If so then then the following ideas should help get you going.
The basic difference is that in synchronous operation an action to do something is performed in one continuous step whereas in asynchronous operation a request is made to perform an action and control is immediately returned. Some time later when the action has been performed then the results are communicated back as a separate step.
Synchronous operation has the advantage of simplicity and is fine when the operation can be performed quickly. Asynchronous operation is more complex both for the requestor and action taker but is much more flexible, allowing other work to continue and is particularly good when the operation may take some time to complete.
The Webserver on the ESP8266 is a good example where there are both synchronous and asynchronous versions. In the simple standard built in synchronous case a request like a GET is performed synchronously and the result must be generated and fed back to the client all in one step. The ESO8266 cannot do anything else in the meantime. For the asynchronous case the GET initiates an action to generate the result and when that becomes available then the http response is generated and sent back. So for example if the request generated a request to read a temperature and that took seconds then no other useful work could be done while this was being done in a synchronous system. Another advantage of the asynchronous approach is that it becomes possible to accept multiple requests without waiting for each to complete.
Synchronous and asynchronous methods can be applied to virtually any activity with the choice being made between simplicity and efficiency.
See
https://www.bmc.com/blogs/asynchronous-programming/ for a general introduction