Synchronous execution means the execution happens in a single series. A->B->C->D
. If you are calling those routines, A
will run, then finish, then B
will start, then finish, then C
will start, etc.
With Asynchronous execution, you begin a routine, and let it run in the background while you start your next, then at some point, say "wait for this to finish". It's more like:
Start A->B->C->D->
Wait for A
to finish
The advantage is that you can execute B
, C
, and or D
while A
is still running (in the background, on a separate thread), so you can take better advantage of your resources and have fewer "hangs" or "waits".