Common synchronization and asynchronous differences, features, and connections in Java

Source: Internet
Author: User
Java common synchronization and asynchronous differences, characteristics, contact synchronization: Send a request, wait to return, and then send the next request
Asynchronous: Sends a request, does not wait to return, can send the next request at any time
Synchronization can avoid deadlocks, read dirty data, generally share a resource when used, if everyone has modify permissions, while modifying a file, it is possible for one person to read what another person has deleted, error, synchronization will be in order to modify.
Asynchronous is to improve efficiency, now the CPU is dual-core, four-core, asynchronous processing can be multi-task at the same time, of course, it must be guaranteed to be processed concurrently.
These are all right.
The biggest difference between synchronous and asynchronous is. One needs to wait, one does not need to wait.
Broadcast, for example, is an asynchronous example. The initiator does not care about the recipient's status. No need to wait for the recipient's return information
Telephone, is a synchronous example. The initiator waits for the receiver, and the communication begins when the phone is connected. Need to wait for the recipient's return information reproduced from csdn--Litaibai not white http://blog.csdn.net/daguairen/article/details/52515264

Common synchronization and asynchronous differences, features, and connections in Java

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.