Home      Discussion      Topics      Dictionary      Almanac
Signup       Login
Synchronization (computer science)

Synchronization (computer science)

Overview
In computer science
Computer science
Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems. It is frequently described as the systematic study of algorithmic processes that create, describe and transform...

, synchronization refers to one of two distinct but related concepts: synchronization of processes, and synchronization of data. Process synchronization refers to the idea that multiple processes are to join up or handshake at a certain point, so as to reach an agreement or commit to a certain sequence of action. Data synchronization refers to the idea of keeping multiple copies of a dataset in coherence with one another, or to maintain data integrity.
Discussion
Ask a question about 'Synchronization (computer science)'
Start a new discussion about 'Synchronization (computer science)'
Answer questions from other users
Full Discussion Forum
 
Encyclopedia
In computer science
Computer science
Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems. It is frequently described as the systematic study of algorithmic processes that create, describe and transform...

, synchronization refers to one of two distinct but related concepts: synchronization of processes, and synchronization of data. Process synchronization refers to the idea that multiple processes are to join up or handshake at a certain point, so as to reach an agreement or commit to a certain sequence of action. Data synchronization refers to the idea of keeping multiple copies of a dataset in coherence with one another, or to maintain data integrity. Process synchronization primitives are commonly used to implement data synchronization.

Process synchronization


Process synchronization refers to the coordination of simultaneous threads or processes to complete a task in order to get correct runtime order and avoid unexpected race condition
Race condition
A race condition or race hazard is a flaw in an electronic system or process whereby the output and/or result of the process is unexpectedly and critically dependent on the sequence or timing of other events...

s.

There are many types of synchronization:
  • Barrier
    Barrier (computer science)
    In parallel computing, a barrier is a type of synchronization method. A barrier for a group of threads or processes in the source code means any thread/process must stop at this point and cannot proceed until all other threads/processes reach this barrier....

  • Lock
    Lock (computer science)
    In computer science, a lock is a synchronization mechanism for enforcing limits on access to a resource in an environment where there are many threads of execution. Locks are one way of enforcing concurrency control policies.-Types:...

    /Semaphore
    Semaphore (programming)
    In computer science, a semaphore is a protected variable or abstract data type which constitutes the classic method for restricting access to shared resources such as shared memory in a parallel programming environment. A counting semaphore is a counter for a set of available resources, rather than...

  • Thread join
  • Mutex
  • Monitors
    Monitor (synchronization)
    In concurrent programming, a monitor is an objectintended to be used safely by more than one thread.The defining characteristic of a monitor is that its methods are executed with mutual exclusion....

  • Non-blocking synchronization
    Non-blocking synchronization
    In computer science, non-blocking synchronization ensures that threads competing for a shared resource do not have their execution indefinitely postponed by mutual exclusion...

  • Events
    Event (synchronization primitive)
    In computer science, an event is a type of synchronization mechanism that is used to indicate to waiting processes when a particular condition has become true.An event is an abstract data type with a boolean state and the following operations:...

  • Rendezvous
  • Event counters and sequencers
  • Synchronous communication operations (see: Comparison of synchronous and asynchronous signalling
    Comparison of synchronous and asynchronous signalling
    Synchronous and asynchronous transmissions are two different methods of transmission synchronization. Synchronous transmissions are synchronized by an external clock, while asynchronous transmissions are synchronized by special signals along the transmission medium.-The need for...

    )

Data synchronization


A distinctly different (but related) concept is that of data synchronization. This refers to the need to keep multiple copies of a set of data coherent with one another.

Examples include:
  • File synchronization
    File synchronization
    File synchronization in computing is the process of making sure that files in two or more locations are updated through certain rules....

    , such as syncing a hand-held MP3 player to a desktop computer.
  • Cluster file systems, which are file system
    File system
    In computing, a file system is a method for storing and organizing computer files and the data they contain to make it easy to find and access them...

    s that maintain data or indexes in a coherent fashion across a whole computing cluster.
  • Cache coherency
    Cache coherency
    In computing, cache coherence refers to the integrity of data stored in local caches of a shared resource. Cache coherence is a special case of memory coherence....

    , maintaining multiple copies of data in sync across multiple cache
    Cache
    In computer science, a cache is a collection of data duplicating original values stored elsewhere or computed earlier, where the original data is expensive to fetch or to compute, compared to the cost of reading the cache. In other words, a cache is a temporary storage area where frequently...

    s.
  • RAID
    RAID
    RAID is an acronym first defined by David A. Patterson, Garth A. Gibson, and Randy Katz at the University of California, Berkeley in 1987 to describe a redundant array of inexpensive disks, a technology that allowed computer users to achieve high levels of storage reliability from low-cost and less...

    , where data is written in a redundant fashion across multiple disks, so that the loss of any one disk does not lead to a loss of data.
  • Database replication, where copies of data on a database
    Database
    A database is an integrated collection of logically related records or files consolidated into a common pool that provides data for one or more multiple uses....

     are kept in sync, despite possible large geographical separation.
  • Journalling
    Journaling file system
    A journaling file system is a file system that logs changes to a journal before committing them to the main file system...

    , a technique used by many modern file systems to make sure that file metadata are updated on a disk in a coherent, consistent manner.

Mathematical foundations


An abstract mathematical foundation for synchronization primitives is given by the history monoid
History monoid
In mathematics and computer science, a history monoid is a way of representing the histories of concurrently running computer processes as a collection of strings, each string representing the individual history of a process...

. There are also many higher-level theoretical devices, such as process calculi and Petri net
Petri net
A Petri net is one of several mathematical modeling languages for the description of discrete distributed systems. A Petri net is a directed bipartite graph, in which the nodes represent transitions , places A Petri net (also known as a place/transition net or P/T net) is one of several...

s, which can be built on top of the history monoid.

External links