Open In App

Language Synchronization Mechanism in Distributed Systems

Last Updated : 24 May, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Distributed Systems refers to a network of interconnected computers or entities that work together as a unified system, despite being physically or geographically dispersed or we can say that It is a group of computers that work together to perform a common task, even though they are physically separated and may be located in different places. The computers communicate with each other and share resources such as data and processing power to achieve their common goal.

Synchronization Mechanism

In distributed systems multiple processes or machines work together to achieve a common goal, synchronization is critical to ensure that these processes work in a coordinated and orderly manner. Synchronization mechanisms are essential for ensuring that multiple processes or nodes can access shared resources and communicate with each other correctly and safely.

The synchronization mechanism is categorized into two parts:

  1. Shared Memory synchronization
  2. Message passing synchronization

Shared Memory Synchronization

Shared memory synchronization is important to ensure that multiple nodes can access and modify shared data without causing conflict or inconsistencies.

The method of shared memory synchronization is listed below:

1. Semaphore:

  • A shared variable and system call approach
  • A shared integer variable with non-negative values, having the following operations:
    – Initialization
    – Indivisible operation P & V,  P  – for acquiring the lock and V – for releasing the lock.

2. Monitor:

  • A data type abstraction approach
  • An object concept model has a user-defined data type structure.
  • High-level abstraction tool, having 3 features:  Shared data, Operation in data and Synchronization, Scheduling

3. Serializer:

  • It is a combination of data abstraction and a control structure approach.
  • An extension of the monitor approach to achieve concurrency, also maintain the atomicity of the operation of a procedure
  • Has 2 types of regions: 1) where a process access the serializer and 1) Hollow, where multiple processes can be active.

4. Mutual Exclusion:

  • Also Known as Mutexes (short form) is synchronization primitive exclusive access to a shared resource. they can be implemented using language-specific construct or Libraries, allowing threads or process to acquire and releases locks to ensure that only one thread can access the shared resource at a time.

5. Path Expression:

  • Data abstraction and programmed controlled approach
  • The order of procedure execution must follow the constraints set by the path expression

6. Locks: 

As the name suggests they are used to provide special peculiar access to a shared resource. A process or thread must first acquire a lock on it where if a lock is acquired over a process no other process can have access to that shared resource. There are several types of locks such as:

  • Binary lock
  • Read-write lock
  •  Spinlock

Message Passing synchronization 

It involves implementing a protocol to ensure that messages are delivered in the correct order and that all nodes receive the same message.

The method of Message passing  synchronization includes:

  • Communicating sequential process
  • Remote procedure call
  • Ada Rendezvous

Communication sequential process

  • An input/output approach
  • First language(CSP) to solve synchronization problems in distributed systems.
  • Sender process P can issue an output command to the receiver process with a corresponding input command.

Remote Procedure call (RPC)

  • Data can be passed between the caller and called procedure.
  • The caller is blocked until the called procedure is completed.
  • Procedure call and Asymmetrical communication approach.

Ada Rendezvous

  • Procedure call and symmetrical communication approach.
  • A non-deterministic language construct for the concurrent process.

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads