The difference between synchronous and asynchronous Details

Said said synchronous and asynchronous what is the difference?

 

Introduction: During network programming, we often see synchronous, asynchronous, blocking, non-blocking calls four kinds of ways, and their combinations. Wherein the synchronous, asynchronous mode is mainly controlled by the client.

 

First talk about their concepts:

Synchronization A linear implementation, process execution can not exceed.

Asynchronous A parallel processing without waiting for completion of execution of a program, can perform other tasks.

 

In the talk about their general scenarios:

Synchronization, generally used in the process is strong, such as making login system. It requires a user name, password, and to verify before they can cross the border.

Asynchronous, scheduled tasks, ajax request and the like, commonly used callback function processing (vernacular: I met side, watching the phone) in our program.

 

They talk about the scene in mind:

Synchronization, all operation is completed, to the user. This has a downside is that online users wait, give people a feeling page card refuses to move. This case, the user interface can not be closed, or the migration program was discontinued.

Asynchronous request directly into the message queue, and feedback to the user. Equivalent system migration process has started, we can close the browser, because the program will himself slowly written to the database, the user will not have to feel stuck.

 

~ ~ ~ ~ Is completed, which is the difference between synchronous and asynchronous of a detailed, you read this article you do not have in other saw.

 

Published 53 original articles · won praise 61 · views 50000 +

Guess you like

Origin blog.csdn.net/qq_40884473/article/details/103178716