Synchronization (computer science)

The programming is meant by process synchronization (or you just sync ) the coordination of the timing of several concurrent processes or threads. It is irrelevant whether they are threads in a program to run programs on a computer or to processes in a distributed system that communicate over a network.

The purpose of coordination is usually one of the following:

  • Shared access to data. It must be prevented that occur in the data by simultaneous access inconsistencies. This is realized by mutex method for mutual exclusion.
  • Sharing limited resources such as peripheral devices. This mutex methods can also be used, but frequently more complex methods of scheduling are needed.
  • Transfer of data or messages from one process to another, ie inter-process communication.
  • Control of sub-processes by signals, especially the killing part or waiting that they terminate.

The synchronization of the processes consists in the fact that in general, a process must wait for an event that is triggered by another. It is the task of the scheduler to implement the resulting causal dependencies so that a process only ever gets CPU time, if all necessary conditions are met. This is usually achieved by the classical control mechanisms such as locks, semaphores and monitors concrete terms.

The dependencies between the processes can be formally modeled, for example, by a Petri net. A typical problem in this connection is that processes can jam when circular dependencies form - which is clearly for example in the problem of dining philosophers. Another prototypical problem is the control of a producer / consumer system.

663325
de