Jump to content
xisto Community
Sign in to follow this  
hippiman

Asynchronous Vs. Synchronous Execution What does it really mean?

Recommended Posts

A while ago, I was learning about threads, and about asynchronous and synchronous functions.

The way this site explains it, synchronous code makes the current code wait for the function you called to return. Asynchronous functions are called, but the current code just continues after it starts the function.

What I don't understand is why they use them the way they do. I'm pretty sure synchronous means something about more than one thing being in sync.
("occurring or existing at the same time or having the same period or phase" from google's definition.)
Asynchronous is just the opposite, then, meaning more than one thing not being in sync.
("not occurring or existing at the same time or having the same period or phase ".)

So, if synchronous code has to wait for a return, that means that the current code and the called function are not executing at the same time, and therefore not synchronous, right?
And if asynchronous code doesn't wait for a return, that means the current code and the called function are executing at the same time, and not asynchornous.

I don't get it.

If someone has some better way of explaining it that makes their definitions make sense, I'd appreciate it.

It seems to me that they just used those words backwards to confuse people while they're explaining threads. :P

Share this post


Link to post
Share on other sites
Reply to: Asynchronous Vs. Synchronous Execution - What does it really mean?Asynchronous Vs. Synchronous Execution

The concept of synchronous and asynchronous calls is fine as youExplained it first. You may want to search for the concept of"concurrency" and concurrent processes execution since that's more orLess what you're pointing out on your comments.

-reply by Allan

Share this post


Link to post
Share on other sites
All in one process Vs occuring in different processesAsynchronous Vs. Synchronous Execution

This confused the hell out of me too.  I came to understand it this way.

Synchronous is a set of 2 distinct yet related concepts.  If you think of processing a web form, all of the steps in the web form occur in a single workflow process.  When submitting a web form for instance, you click submit you shake hands with data verification handling "synchronize" the data. Hence they are all part of one complete phase.

Asynchronous is a set of 2 separate processes executing.  The threads are executing at different times I.E. 2 different phases.

-reply by Mike

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.