Synchronous communication

from Wikipedia, the free encyclopedia

In computer science and network technology , synchronous communication is a mode of communication in which the communication partners ( processes ) always synchronize when sending or receiving data , i.e. wait ( block ) until communication is complete. If both sending and receiving are waited (the sender makes a request and waits for an answer), this corresponds to a rendezvous between the two processes involved.

The process is blocked internally using suitable process synchronization mechanisms . This means that synchronization goes beyond pure transaction orientation. Sending and receiving data without blocking the process is called asynchronous communication . This also allows transaction-oriented operation.

Synchronous communication should not be confused with the term synchronous data transfer , which refers to media access methods .

Synchronous reception mode

Waiting for data to be received (blocking reception) is also called "blocking read" or "synchronous receive" . It corresponds to the behavior of a consumer in a queue or the behavior of a processor of a data stream : The process essentially consists of a loop that waits until data is available, processes it and then waits again. The processing of the received data can also consist in calling handling routines for certain types of data. This corresponds to the semantics of event handling .

In the case of non-blocking read , "asynchronous receive" , the command to receive data simply returns an error if there is no data in the input buffer. The process would then simply check at regular intervals whether data is available and otherwise devote itself to other tasks (for example communicating with a third process).

Another mode for receiving data are guarded statements according to Leslie Lamport : Here the receiver does not wait for data from a specific data stream, but from any data stream, so that a single process can serve several data streams in parallel. The reception is then synchronous with respect to a "bundle" of other processes, not with respect to a single process. This technique is mainly used in servers .

Synchronous request

Often data is transmitted in the sense of a request ( client-server system ) to which an immediate response is expected. In this case, the client process sends a request and waits ( blocks ) until a response comes from the server - one also speaks of closely coupled processes or rendezvous semantics. The lack of a response is then regarded as an error after a certain time ( timeout ). However, the request is often retried a few times before finally reporting an error, especially if the underlying channel is unreliable .

This semantics is of the usual client-server - protocols used, and for the direct function call in other processes ( Remote Procedure Call ). If only a confirmation is expected as a response to a request , the process can be viewed as a simple blocking sending .

An alternative to synchronous call semantics would be to expect no response at all. It depends on the underlying network layer whether it is ensured that the recipient has actually received the data. In general, however, this security is not given, especially not when transmitting over a network .

Another possibility is the asynchronous request : After a message has been sent, the process continues to work and checks (possibly in addition to other activities) again and again whether messages have been received from other processes. These messages are then processed, no distinction is made between "inquiries" and "replies". This is also called a loose coupling of the processes.

Communication between ICs

When communicating between different chips, one speaks of synchronous communication when a clock signal is used to synchronize the transmitter and receiver signal with one another (to avoid drifting apart into asynchrony).

Signals can also be prevented from drifting apart using other strategies (e.g. bit stuffing ); however, this is mostly used for asynchronous communication.

Examples of synchronous communication variants

Examples of synchronous communication between people

Synchronous communication includes: B. the following communication forms and techniques:

  • conventional telephony (e.g. cellular , landline ). In the IP telephony asynchrony can already occur (at low quality of service, QoS ).
  • Instant messaging
  • IRC chats
  • Web chats
  • Internet video conferencing

See also