Download presentation
Presentation is loading. Please wait.
1
Slide 18-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18
2
Slide 18-2 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 18 Distributed Programming Runtime Systems
3
Slide 18-3 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 PVM Architecture OS 1 OS 2 OS 1 OS 2 PVM Implementation PVM 1 PVM 2 Implement 1 Implement 2
4
Slide 18-4 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 The SPMD Computation in the PVM Main Program #define NPROC 4 #include #include “pvm3.h” main() { int mytid; /* my task id */ int tids[NPROC]; /* array of task id */ int me; /* my process number */ int i; mytid = pvm_mytid(); /* enroll in pvm */ /* Join a group; if first in the group, create other tasks */ me = pvm_joingroup(“foo”); if(me == 0) pvm_spawn(“spmd”, (char**)0, 0, “”, NPROC–1, &tids[1]); /* Wait for everyone to startup before proceeding. */ pvm_barrier(“foo”, NPROC); /*––––––––––––––––––--------------------------------------–-*/ dowork(me, NPROC); /* program finished leave group and exit pvm */ pvm_lvgroup(“foo”); pvm_exit(); exit(1); }
5
Slide 18-5 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 The SPMD dowork Function in PVM dowork(int me, int nproc) { int token, src, dest;; int count = 1, stride = 1, msgtag = 4; /* Determine neighbors in the ring */ src = pvm_gettid(“foo”, me-1); dest= pvm_gettid(“foo”, me+1); if(me == 0) src = pvm_gettid(“foo”, NPROC-1); if(me == NPROC-1) dest = pvm_gettid(“foo”, 0); if(me == 0) { token = dest; pvm_initsend(PvmDataDefault); pvm_pkint(&token, count, stride); pvm_send(dest, msgtag); pvm_recv(src, msgtag); printf(“token ring done\n”); } else { pvm_recv(src, msgtag); pvm_upkint(&token, count, stride); pvm_initsend(PvmDataDefault); pvm_pkint(&token, count, stride); pvm_send(dest, msgtag); }
6
Slide 18-6 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 The DCE Distributed File System File Exporter Applications File Storage Cache Manager Client Stubs Client Token Manager VFS+ Network Layer Other User Space Services Local File System Server
7
Slide 18-7 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 DCE Security Components ClientApplication Server Administrator Security Server ApplicationsApp Service Login Admin Interface Authentication Privilege Registry ACL Security DB Session Authentication Client-server information DCE Security information User Authentication Authorization
8
Slide 18-8 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 Mobile Java Code Server Service Client JVM Web Runner Java Applet 1 Process 2
9
Slide 18-9 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 Java Thread Class public class MyThread extends Thread { public MyThread(…) { // The constructor } public void run() { // Insert the thread code here }
10
Slide 18-10 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 Remote Objects – Servers inside Clients ClientServer Web Browser 1. Load Applet Service Applet/Object 2. RMI 3. RMI resultClient Behavior Server Behavior
11
Slide 18-11 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 Security in the Java Environment Server Service Client Web Browser Applet/Object JVM 1 23 Process
12
Slide 18-12 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 Address Spaces, Application Domains, Assemblies, and Modules OS Process Address Space CLI Address Space App Domain Module Assembly App Domain App Domain
13
Slide 18-13 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 The Virtual Execution System (VES) JIT Compiler JIT Compiler Native Code Class Info Call within class Call across classes Call across assembly Assembly Storage Install Assembly in App Domain Install and Bind Classes App Domain
14
Slide 18-14 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 18 Remoting Transparent Proxy Transparent Proxy Real Proxy Real Proxy Channel Remoting call Marshaling (Serialization) Unmarshaling (Deserialization) (Local call) Result Or Exception RMI App Domain Assembly Address Space
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.