) Understanding of synchronization and Asynchronization (Ajax Network Programming)

Source: Internet
Author: User

In computers, the concept of Asynchronization is often used. So what should I do with it?

Here is an example:
For example, I will call you to ask you some questions. After you receive the call, you say you need to check some information. At this time, I have two options. If you say you will be able to fix it soon, then I will take the receiver and wait for your results. This is synchronization. If you say it takes a long time, then I don't have to wait there, I said that I had to call the phone first, and you found the information before notifying me. Then I did something else. This is asynchronous.

Synchronization is serialIn line with the general structured process, a function call will know the final execution result.
Asynchronous is concurrentIn the operation process, there is no need to wait, and the efficiency is high, but it is troublesome to handle.

IfChina Telecom transmission refers to the sending and receiving ends in each same cycle., Each unit of data is sent and received under the positioning of the clock;Asynchronous means that the event is not sent in every fixed clock cycle.Instead of sending a batch of data from time to time.
ForSoftware,Synchronization means that a process/thread continues after it executes an operation and waits for the action of another process/thread.Like two processes following certain rules, you wait for me to wait for you to come together;Asynchronous means that after a process performs an operation, it does not have to wait for the result of another process to continue to perform the following operations.The events of the two processes do not have the same relationship.

So socket synchronous transmission,ProgramThe returned result shows that the data has been transferred. The asynchronous sending and receiving actions may be different for a long time. Data is retained first in queue and buffer mode.

This is also true in network programming. Ajax works asynchronously and does not require the server to send more data each time. It refreshes the entire page, but only needs partial refresh.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.