Differences between synchronous requests and asynchronous requests (for AJAX purposes)

Source: Internet
Author: User

Synchronization request: After the sender sends a packet, it waits for the receiver to send back a response before sending the next packet's communication mode.

Asynchronous request: After sending a packet, the sender can send the next packet to communicate without waiting for the receiver to send back the response.

Synchronous communication: The communication between the two sides at the same clock frequency, and accurate coordination, through the sharing of a single clock or timing pulse source to ensure accurate synchronization between the two sides, high efficiency.

Asynchronous communication: Do not require synchronization between the two parties, the two sides can adopt their own time source, follow the asynchronous communication protocol, the character is the data transmission unit, the transmission of the character interval is uncertain, the transmission efficiency is lower than synchronous communication.

Synchronization request: Through a single-threaded service, the thread sends a request, blocks when the server is running, and waits for a response.

Asynchronous request: The service is invoked through two threads, one thread sends the request, and another individual thread receives the response.

Synchronization: When the service is running, the block crashes and the restart service cannot connect to the call, so the response is lost. You can only repeat the call procedure and expect this time to not crash.

Async: When a consumer sends a request and waits for a response to crash, the restart service continues to wait for the response, so the response is not lost.

The synchronization request cannot continue to use the browser while waiting for the response, but the asynchronous request, without waiting for a response, continues to use the browser. No effect on the customer.

Differences between synchronous requests and asynchronous requests (for AJAX purposes)

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.