Jump to content
Xisto Corporation
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
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.