Synchronous call / asynchronous call / call-way synchronous / asynchronous blocking / non-blocking

Called

Synchronous call: the client sends the results after the call waiting service request to return before continuing logic;

Asynchronous calls: Calls made after the client continue with other business logic, the server returns the results and processing results from the callback handler class;

One-way call: Client Calls made after the end of the call, the server does not return a result of the call.

Synchronous and asynchronous

Synchronous and asynchronous communication mechanism is concerned that the message (synchronous communication / asynchronous communication)

The so-called synchronous, is issuing a call when, in the absence of the results obtained, the call will not return. But once the call returns, the return value is obtained. In other words, the caller actively waiting for this call results.

The induction is the opposite, call after issuing this call directly returned, so no results are returned. In other words, when an asynchronous procedure call is issued, the caller will not immediately get results. But the call is issued, the caller through the state, notification to inform the caller, or to deal with this by calling the callback function.

Blocking and non-blocking

Blocking and non-blocking concern is the state of the program while waiting for the result of the call (the message, the return value) of.

Blocking call refers to the results before the call returns, the current thread is suspended. Only the calling thread does not return until after the result.

Before non-blocking call refers not get the results immediately, the call does not block the current thread.

Published 202 original articles · won praise 14 · views 40000 +

Guess you like

Origin blog.csdn.net/LU_ZHAO/article/details/105021794