Definition of Synchronous and Asynchronous

Hi, before I explain this programming methods, we need to know how the program is executed. The time in which a program runs in a operating system or environment is called the runtime, in this process we executed instructions of algorithms in that way we will have our final system.

This system is fed by inputs that, at the same time result in outputs, it is as if they were in line waiting for their turn, and this in turn incurs a waiting time, ideally short.

Trying to optimize that process, one classic solution is assign that waiting time to other process, that can run without taking a long time.  thus taking advantage of CPU usage. 

Our unfinished process remains in the queue, while another takes its place. When the conditions for the correct execution of this process are there (and the CPU is free), it resumes.

Here is where the play begin with methods Synchronous and Asynchronous calls. 

In Synchronous methods we wait for results, this means that if we call a method we will wait in that point until we have a result (or error).

In Asynchronous make a call but continues with the execution and in general we defined a callback (function or method) that will receive the result or error to take a decision. But in this flow the execution doesn’t wait the result, instead the flow continue and doesn’t block the execution of the current thread. 

By Criss.