ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Parallel & Distributed Computing
    COMP3139
    Progress0 / 33 topics
    Topics
    1. Introduction to Parallel and Distributed Systems2. Why Use Parallel and Distributed Systems?3. Speedup and Amdahl's Law4. Hardware Architectures: Multi Processors (Shared Memory)5. Hardware Architectures: Networks of Workstations (Distributed Memory)6. Hardware Architectures: Clusters (Latest Variation)7. Software Architectures: Threads and Shared Memory8. Software Architectures: Processes and Message Passing9. Software Architectures: Distributed Shared Memory (DSM)10. Software Architectures: Distributed Shared Data (DSD)11. Parallel Algorithms12. Concurrency and Synchronization13. Data and Work Partitioning14. Common Parallelization Strategies15. Granularity16. Load Balancing17. Examples of Parallel Algorithms: Parallel Search18. Examples of Parallel Algorithms: Parallel Sorting19. Shared-Memory Programming20. Threads in Shared-Memory Programming21. P Threads22. Locks and Semaphores23. Distributed-Memory Programming24. Message Passing25. Map Reduce26. Distributed-Memory Programming with PI27. Google's Map Reduce28. Hadoop29. Other Parallel Programming Systems30. Tread Marks31. Distributed Shared Memory32. Aurora: Scoped Behavior and Abstract Data Types33. S Enterprise: Process Templates
    COMP3139›Software Architectures: Distributed Shared Memory (DSM)
    Parallel & Distributed ComputingTopic 9 of 33

    Software Architectures: Distributed Shared Memory (DSM)

    9 minread
    1,519words
    Intermediatelevel

    Software Architectures: Distributed Shared Memory (DSM)

    Distributed Shared Memory (DSM) is a model for managing memory in a distributed computing environment. Unlike traditional shared memory systems, where multiple threads in a single machine can access a common address space, DSM enables processes running on different machines to access a logically shared memory space. The underlying system takes care of the complexities of keeping this distributed memory consistent and coherent, often abstracting away the details of how and where the memory is physically stored.

    In DSM, the illusion of a single, shared address space is provided, even though the physical memory may be spread across multiple nodes in a network. This makes it easier for programmers to design parallel and distributed applications without worrying too much about the underlying network communication and synchronization mechanisms.


    1. What is Distributed Shared Memory (DSM)?

    Distributed Shared Memory (DSM) is a memory abstraction that allows multiple processes running on different machines (nodes) in a network to access a logically shared memory. DSM provides the illusion of a single address space that is globally accessible, even though each machine has its own local memory.

    The main goal of DSM is to simplify programming in distributed systems by allowing processes to communicate and share data as if they were running on a shared memory system, while hiding the complexities of distributed communication, data consistency, and synchronization.

    Key Features of DSM:

    • Global Address Space: DSM provides the illusion of a single memory space, where processes across different machines can read from and write to memory locations as if they were local.
    • Transparency: The system abstracts away the physical distribution of memory and the underlying communication protocols, making the programming model simpler and more similar to traditional shared memory programming.
    • Consistency and Coherency: DSM systems must maintain memory consistency (the order in which changes to memory appear to different processes) and coherency (ensuring all copies of data are consistent across different nodes) despite being distributed across several machines.

    2. DSM System Architecture

    In a typical DSM system, there are several key components:

    • Nodes: Each machine or process that is part of the system, with its own local memory.
    • DSM Manager/Server: A component responsible for managing the memory, coordinating access between nodes, and maintaining consistency.
    • Memory Pages: The logical memory is divided into pages that can be mapped into the address space of different nodes.
    • Communication Layer: The underlying network communication that allows processes on different nodes to exchange memory content.

    DSM Components:

    1. Local Memory: Each node has its own local memory, and the DSM abstracts this local memory into a unified global memory.
    2. Page Faults: When a process accesses a memory page that is not present locally, a page fault occurs, and the DSM system retrieves the required data from another node’s memory over the network.
    3. Cache Coherency: If multiple copies of the same memory page are cached in different nodes, the DSM system ensures that all copies remain consistent. This is typically done through a write-invalidate or write-update mechanism.

    3. Types of DSM Systems

    DSM systems can be classified based on their consistency and synchronization mechanisms:

    1. Strict Consistency:

    • In a system with strict consistency, every read or write to shared memory is immediately visible to all processes in the system. This means that if a process writes to a memory location, all other processes see the update immediately.
    • Challenge: Strict consistency can lead to significant performance overheads due to constant synchronization and communication between nodes.

    2. Sequential Consistency:

    • A sequentially consistent DSM system ensures that the results of operations on shared memory appear as if they were executed in some sequential order. However, the system does not guarantee that the operations happen in real-time order.
    • Challenge: This approach can be more efficient than strict consistency but still requires careful synchronization.

    3. Relaxed Consistency Models:

    • Eventual Consistency: In some DSM systems, updates to shared memory may not be immediately visible to all processes. Instead, the system guarantees that all nodes will eventually converge to a consistent state, but not necessarily at all times.
    • Lazy Consistency: This allows for delayed propagation of updates, meaning changes made to shared memory may not be visible to all nodes immediately, leading to higher performance at the cost of some consistency.
    • Example: Amazon’s DynamoDB uses eventual consistency for high availability and scalability.

    4. Release Consistency:

    • Release consistency is a more relaxed model where memory updates are made visible when a process releases a lock, but they do not need to be visible during the acquire phase. This is a common approach in large-scale parallel systems where performance is prioritized over immediate consistency.

    4. DSM Implementation Models

    DSM can be implemented using different strategies for memory management, consistency maintenance, and communication:

    1. Page-based DSM:

    • In page-based DSM, the logical memory is divided into fixed-size pages. Each page can be either read-only or writable, and when a process accesses a page that is not available locally, the system fetches the page from another node’s memory.
    • Example: The TreadMarks system is an example of a page-based DSM system that provides a shared memory abstraction for distributed systems.

    2. Object-based DSM:

    • Instead of dividing memory into pages, object-based DSM allows for sharing of objects (structured data). The memory is mapped and managed at the granularity of objects rather than pages, providing better support for object-oriented programming paradigms.
    • Example: Linda and Emerald are object-based DSM systems.

    3. Cache-based DSM:

    • Cache-based DSMs work by maintaining cached copies of shared memory pages on different nodes. These caches are kept consistent with each other through coherence protocols. The goal is to reduce latency by keeping data closer to the process that needs it, but with mechanisms to ensure consistency.
    • Example: Cache Coherent DSM (CCDSM) uses cache coherency protocols to keep memory copies consistent across nodes.

    5. DSM Synchronization and Communication

    For DSM systems to function effectively, synchronization and communication mechanisms are critical:

    Synchronization Mechanisms:

    • Locks: Used to control access to shared memory regions to avoid race conditions. Locks can be implemented with local or global synchronization mechanisms, and their use impacts performance and scalability.
    • Barriers: A barrier synchronizes all processes by forcing them to wait until all processes reach the same point in execution.
    • Semaphores and Condition Variables: These can be used for more granular control over the shared memory, enabling processes to wait or signal other processes when certain conditions are met.

    Communication Mechanisms:

    • Message Passing: While DSM abstracts the shared memory, messages are still passed between nodes to manage data consistency. These messages may include memory updates, cache invalidations, or requests for memory pages.
    • Remote Memory Access (RMA): Some DSM implementations use remote memory access protocols, allowing processes to read or write to the memory of another node directly.

    6. DSM Consistency Protocols

    Maintaining consistency in a distributed system is challenging, and several consistency protocols are commonly used in DSM systems:

    1. Write-invalidate Protocol:

    • When a process writes to a shared memory page, other processes that have cached copies of that page are invalidated. This ensures that no stale data is used by other processes, but can lead to cache misses and increased network traffic.

    2. Write-update Protocol:

    • Instead of invalidating cached copies of a page, the system updates all other copies when a process writes to the page. This approach reduces the need for cache misses but can increase the amount of communication between nodes.

    3. Lazy Update Protocol:

    • In lazy update protocols, updates are delayed until a process explicitly synchronizes its state with others, reducing the number of network operations required. However, this can lead to inconsistencies during the delay period.

    7. Advantages and Disadvantages of DSM

    Advantages:

    1. Simplified Programming: DSM abstracts away the complexity of inter-process communication and allows developers to use shared memory programming models in a distributed environment, making the system easier to program.
    2. Scalability: DSM systems can scale across multiple nodes, handling larger datasets and workloads.
    3. Transparency: The distribution of memory is hidden from the programmer, allowing them to focus on higher-level logic rather than low-level synchronization and communication.
    4. Fault Tolerance: DSM systems can be designed to tolerate faults in the network or individual nodes, ensuring that the system remains available.

    Disadvantages:

    1. Performance Overheads: Maintaining consistency and coherency across distributed memory is computationally expensive, especially in systems with high latency or a large number of nodes.
    2. Complexity: Implementing DSM in a distributed system is complex, and managing the underlying communication, synchronization, and consistency can introduce significant complexity.
    3. Consistency Issues: Ensuring that all nodes see a consistent view of memory, especially in the face of network delays or failures, is a challenge. Relaxed consistency models can introduce complexity in reasoning about correctness.
    4. Limited Scalability: As the number of nodes increases, the performance of DSM systems may degrade due to the increased communication overhead and memory management complexities.

    8. Use Cases of DSM

    • **High-performance Computing (HPC
    Previous topic 8
    Software Architectures: Processes and Message Passing
    Next topic 10
    Software Architectures: Distributed Shared Data (DSD)

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time9 min
      Word count1,519
      Code examples0
      DifficultyIntermediate