TheHingineer

  • Operating System


  • OS Part-1

  • OS Part-2

  • OS Part-3

  • OS Part-4

  • OS Part-5

  • Distributed Shared Memory (DSM) in Operating System

    Introduction

    Distributed Shared Memory (DSM) ek technique hai jo distributed systems me shared memory ka illusion create karti hai, jisme multiple processes ya computers ek hi memory space share karte dikhai dete hain, lekin physically unki memory alag hoti hai. DSM distributed systems me memory ko efficiently share karne aur inter-process communication (IPC) ko simplify karne ke liye use hoti hai.

    💡 Example: Agar ek distributed system me multiple computers connected hain, to DSM ka use karke aise lag sakta hai ki ek hi shared memory available hai, jo ki simpler programming model provide karta hai.


    How DSM Works?

    DSM virtual memory techniques ka use karke ek logical shared memory space provide karta hai. Ye data ko consistency models aur page replication ke through manage karta hai.

    📌 Diagram: DSM Architecture

    +------------------+ +------------------+ +------------------+
    | Process (Node 1) | | Process (Node 2) | | Process (Node 3) |
    |------------------| |------------------| |------------------|
    | Memory 1         | | Memory 2         | | Memory 3         |
    +------------------+ +------------------+ +------------------+
                \                |               /
                 \               |              /
                  \_______ Shared Memory ______/
     

    🔹 Har node (computer) ki local memory hoti hai, lekin system ek global shared memory ka illusion create karta hai.


    Advantages of DSM

    ✅ Simplified Programming Model – Developers bina explicit message passing ke memory share kar sakte hain.
    ✅ Reduced Communication Overhead – DSM me automatic data sharing hoti hai, is wajah se manual IPC techniques ki zaroorat nahi hoti.
    ✅ Scalability – System me naye nodes add kiye ja sakte hain bina major architectural changes ke.
    ✅ Fault Tolerance – Agar ek node fail hota hai, to dusre nodes data ko replicate kar sakte hain.


    Design Issues in DSM

    DSM ka implementation multiple challenges face karta hai:

    1. Data Consistency

    DSM me ek consistency model define kiya jata hai jo ensure karta hai ki multiple processes correct aur up-to-date data access karein.
    🔹 Strict Consistency – Har process hamesha latest update ko dekhega.
    🔹 Sequential Consistency – Execution ka order same hoga, but timing different ho sakti hai.
    🔹 Causal Consistency – Agar ek process dusre ko affect karta hai, to unka order same hoga.
    🔹 Eventual Consistency – Time ke saath data consistency achieve ho jayegi.

    2. Memory Granularity

    DSM me memory page-based ya object-based ho sakti hai.
    🔹 Page-based DSM – Memory ko fixed-size pages me divide kiya jata hai.
    🔹 Object-based DSM – Memory ko logical objects ke form me store kiya jata hai.

    3. Data Replication & Migration

    • -> Replication – Multiple nodes same data ko store kar sakte hain taaki faster access mile.

    • -> Migration – Data dynamically ek node se doosre node pe shift hota hai taaki load balancing achieve ho.

    4. Synchronization

    Jab multiple processes ek shared variable ko access karte hain, to synchronization techniques ka use hota hai:
    🔹 Locks – Ek process ko ek memory block par exclusive access milta hai.
    🔹 Semaphores – Critical sections ka access control karne ke liye.
    🔹 Barriers – Processes ko synchronize karne ke liye taaki sab ek specific point pe ek saath pohonchein.


    Types of DSM Systems

    DSM ko implementation techniques ke basis par classify kiya jata hai:

    1. Hardware-based DSM

    • Ye system special hardware support ka use karta hai jisme cache coherence mechanisms implement hote hain.

    • Example: NUMA (Non-Uniform Memory Access) architectures

    2. Software-based DSM

    • Ye OS-level aur middleware-level solutions ka use karta hai bina kisi special hardware ke.

    • Example: TreadMarks DSM System

    3. Hybrid DSM

    • Ye hardware aur software approaches dono ka combination hota hai.

    • Example: COMA (Cache-Only Memory Architecture)


    Page-based DSM vs. Object-based DSM

    Feature Page-based DSM Object-based DSM
    Granularity Fixed-size pages Logical objects
    Access Control Page-level locks Object-level locks
    Communication Overhead High Low
    Example TreadMarks CORBA

    DSM in Real-World Applications

    🔹 Parallel Computing – Large-scale computations ke liye DSM ka use hota hai.
    🔹 Cloud Computing – Distributed databases DSM ka use karke efficient memory management karti hain.
    🔹 High-Performance Computing (HPC) – Scientific simulations aur data analysis ke liye DSM ka use hota hai.
    🔹 Distributed Databases – SQL aur NoSQL databases DSM ke principles ka use karti hain.


    Conclusion

    Distributed Shared Memory (DSM) ek powerful memory management technique hai jo distributed computing ko simpler aur efficient banati hai. Ye parallel processing, scalability, aur high-performance computing me bahut useful hoti hai. DSM ka proper implementation consistency, synchronization aur replication strategies par depend karta hai.

    Scroll to Top