a = p->b = 0;/* initialize fields to zero */ while(TRUE){/* continuously update structure fields */ p –>a = p –>a + 1; p –>b = p –>b - 1; } Continued on next slide..."> a = p->b = 0;/* initialize fields to zero */ while(TRUE){/* continuously update structure fields */ p –>a = p –>a + 1; p –>b = p –>b - 1; } Continued on next slide...">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

Slides for Chapter 18: Distributed Shared Memory From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Pearson Education.

Similar presentations


Presentation on theme: "Slides for Chapter 18: Distributed Shared Memory From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Pearson Education."— Presentation transcript:

1 Slides for Chapter 18: Distributed Shared Memory From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Pearson Education 2005

2 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.1 The distributed shared memory abstraction

3 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.2 Mether system program - slide 1 #include "world.h" structshared { int a,b; }; Program Writer: main() { struct shared *p; methersetup(); /* Initialize the Mether run-time */ p = (struct shared *)METHERBASE; /* overlay structure on METHER segment */ p->a = p->b = 0;/* initialize fields to zero */ while(TRUE){/* continuously update structure fields */ p –>a = p –>a + 1; p –>b = p –>b - 1; } Continued on next slide...

4 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.2 Mether system program - slide 2 Program Reader: main() { struct shared *p; methersetup(); p = (struct shared *)METHERBASE; while(TRUE) {/* read the fields once every second */ printf("a = %d, b = %d\n", p –>a, p –>b); sleep(1); }

5 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.3 Two processes accessing shared variables a := a + 1; b := b + 1; br := b; ar := a; if(ar ≥ br) then print ("OK"); Process 1Process 2

6 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.4 Interleaving under sequential consistency br := b; ar := a; if(ar ≥ br) then print ("OK"); Time Process 1 Process 2 a := a + 1; b := b + 1; read write

7 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.5 DSM using write-update

8 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.6 Data items laid out over pages

9 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.7 System model for page-based DSM

10 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.8 State transitions under write-invalidation Single writerMultiple reader W (invalidation) R P W writes; none read P R1, P R2,..P Rn read; none write RW (invalidation) Note: R = read fault occurs; W = write fault occurs.

11 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.9 Central manager and associated messages

12 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.10 Updating probOwner pointers – slide 1 (a) probOwner pointers just before process A takes a page fault for a page owned by E

13 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.10 Updating probOwner pointers – slide 2 (b) Write fault: probOwner pointers after A's write request is forwarded

14 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.10 Updating probOwner pointers – slide 3 (c) Read fault: probOwner pointers after A's read request is forwarded

15 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.11 Timeline for performing a DSM read or write operation P issues o o performed with respect to P’ at time t o performed (complete) Real time

16 Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Figure 18.12 Processes executing on a release-consistent DSM Process 1: acquireLock();// enter critical section a := a + 1; b := b + 1; releaseLock();// leave critical section Process 2: acquireLock();// enter critical section print ("The values of a and b are: ", a, b); releaseLock();// leave critical section


Download ppt "Slides for Chapter 18: Distributed Shared Memory From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Pearson Education."

Similar presentations


Ads by Google