Вы находитесь на странице: 1из 8

DISTRIBUTED DISTRIBUTED SYSTEMS SYSTEMS Princip g ples and Paradigms Second Edition ANDREW ANDREW S TANENBAUM S.

TANENBAUM MAARTEN VAN STEEN Chapter 3 Processes 1Processes How the different types of processes play a crucial role in distributed systems. Process : a program in execution. From an O.S. perspective, the management and scheduling of scheduling of processes are perhaps the most important issues to deal with. From an D.S. ToTo efficientl organi e client efficiently organize client-server ser er s stems con enient to se m ltithreading systems, convenient to use multithreading. Using the concept of virtualization. The design issue of servers. Moving Moving processes between different machines. processes between different machines. Process migration or code migration. 2Threads What What a process is a process is. How processes and threads relate. Process Process Table Table. Independent Processes. Concurrency Transparency. Switching between CPU Context. Memory g ( ) y Management Unit (MMU). Translation Lookaside Buffer (TLB). Swap Processes. Thread Thread Context Context. Multithreading. 3Thread Usage in Nondistributed Systems. Several Several benefits to benefits to multithreading p g processes. Large Different Parts In single-thread process, whenever a blocking system Exploit g Application Designed as a collection of cooperating

executed by separate threads. Shared Data Software engineering -blocking system call is executed, the process as a whole is blocked Exploit Parallelism cooperating programs. Large Context Switching. IPC in UNIX Shared Data. Thread switching user space. gg structure as a collection of cooperating. blocked. IPC in UNIX 4Thread Usage in Nondistributed Systems Figure 3-1. Context switching as the result of IPC. 5Thread Implementation Two approaches Construct a tread library in user mode. Kernel be aware of threads and schedule them. User-level thread library Th d Advantages Cheap to Create and Destroy threads. Switching context can be done in few Thread Package instructions. Disadvantages Invocation of blocking system call will ii di t l bl k th ti mmediately block the entire process. 6Thread Implementation K l High price to pay. Every thread operation carried out by k l i i t ll

Kernellevel kernel requiring a system call. Switching contexts may now become as expensive as switching process context. level Threads Hybrid form of user-level and kernel-level threads. Sol tion Lightweight Processes (LWP) Advantages. Drawback. Solution: 7Thread Implementation Figure 3-2. Combining kernel-level lightweight processes processes and user and user-level level threads threads. 8Threads Threads in Distributed in Distributed Systems 9Multithreaded Clients Conceal latencies in communication. Initiate Initiate communication and do communication and do something else. Web Browsers. 10Multithreaded Servers Exploit parallelism to attain high performance. Example file Dispatcher. Worker thread. Example file server. 11Multithreaded Servers (1) Figure 3-3. A multithreaded server organized in a dispatcher/worker model. 12Multithreaded Servers (2) Figure Figure 33-44.. Three ways to construct a server. Three ways to construct a server. 13Virtualization Single-processor illusion. Rapidly switching between threads Create illusion of of parallelism parallelism. Leading to what is known as Resource Virtualization. We will discuss Virtualization. How How it can be realized it can be realized. 14The Role of Virtualization in Distributed Distributed Systems Systems Every (distributed) computer system offer an interface. Basic instruction set offered by CPU.

Vi Vi li i d l i h di l i i i i f i i h rtualization deals with extending or replacing an existing interface so as to mimic the behavior of another system. Most Most important reason is to run legacy software important reason is to run legacy software. Become less of an issue. Then 1990s became more favored for several reasons: Hardware and low-level system software change fast. Legacy cannot be maintained same pace. Virtualization can help by porting the legacy interface to the new platforms. Networking large Heterogeneous collection of server computers, running different application run each on different Virtual machine. 15The Role of Virtualization in Distributed Distributed Systems Systems Figure 3-5. (a) General organization between a program, interface, and sy ( ) g ystem. (b) General organization of virtualizingg sy y ystem A on top of system B. 16Architectures of Virtual Machines (1) An interface between the hardware and soff f tware consisting of machine instructions that can be invoked by any Interfaces that can be invoked by any program. An interface between the hardware and software consisting of machine at different and software, consisting of machine instructions that can be invoked only by different levels privileged programs, such as an operating system. 17Architectures of Virtual Machines (2) An interface consisting of system calls as offered by an operating system. An interface consisting of library Interfaces An interface consisting of library calls generally forming what is known as an application programming at

different as an application programming interface (API). In many cases, the f different levels aforementioned system calls are hidden by an API. 18Architectures of Virtual Machines (3) Figure 3-6. Various interfaces offered by computer systems. 19Architectures of Virtual Machines (4) Figure 3-7. (a) A process virtual machine, with multiple instances instances of (application runtime) combinations of (application, runtime) combinations. 20Architectures of Virtual Machines (5) Figure 3-7. (b) A virtual machine monitor, with multiple instances instances of (applications operating system) combinations of (applications, operating system) combinations. 21CLIENTS 22Networked User Interfaces (1) Figgure 3-8. ( ) pp p (a) A networked application with its own protocol. 23Networked User Interfaces (2) Figure 3-8. (b) A general solution to allow access to remote applications 24Examp y ple: The X Window System Figure 33-99. The The basic organization of the X Window System basic organization of the X Window System. 25Client-Side Software for Distribution Transparency Figure 3-10. Transparent replication of a server using using a client a client-side side solution solution. 26Servers 27General Desig ( gn Issues (1) Organi Organi e Ser ers ze Servers. Iterative Server. Concurrent Concurrent Server Server. How clients contact a server End point port Using daemon. Superserver. How and whether a server can bee interrupted. Abruptly exit break connection. Out-of-band. 28General Desig ( gn Issues (2) Whether Stateless Stateless Server: does not keep Server: does not keep information on the state of its clients and can change its own state without

h i t i f ki t Whether or not having to inform any ckient. Stateful Server: maintains persistent or not the Stateful Server: maintains persistent information on its clients. Session state server is stt t l ateless Permanent state. 29General Desig ( gn Issues (3) Figure Figure 33-1111.. (a) Client (a) Client-toto-server server binding using a daemon. binding using a daemon. 30General Desig ( gn Issues (4) Figure Figure 33-1111. (b) (b) Client Client-toto-server server binding using a binding using a superserver superserver. 31Sever Clusters General General Organization: Organization: Collection of machines connected through a network. Logically organized into three tires: First tier: consists of a (logical) switch through which clients requests are routed. Second tier: contain servers dedicated to application processing. Thi hi d i i f d rd tier: consists of data-processii bl fil ng servers, notably file and database servers. 32Server Clusters (1) Figure Figure 33-1212.. The general organization of a The general organization of a three-tiered server cluster. 33Server Clusters (2) Figure 33-1313. The The principle of TCP handoff principle of TCP handoff. 34Distributed Servers Figure 3-14. Route optimization in a distributed server. 35Manag g ging Server Clusters Example: PlanetLab Figure Figure 33-1515. The The basic organization of a basic organization of a PlanetLab PlanetLab node node. 36PlanetLab (1) PlanetLab management issues: NN d b l t diff t i ti odes belong to different organizations. Each organization should be allowed to specify who who is allowed to run applications on their nodes is allowed to run applications on their nodes, And restrict resource usage appropriately.

Monitoring Monitoring tools a ailable ass me a er specific tools available assume a very specific combination of hardware and software. All All tailored to be used within a single organization tailored to be used within a single organization. Programs from different slices but running on the same same node should not interfere with each other node should not interfere with each other. 37PlanetLab (2) Figure 3-16. The management relationships between between various various PlanetLab PlanetLab entities entities. 38PlanetLab (3) Relationships between PlanetLab entities: A node owner puts its node under the regime of a management authority, possibly restricting usage where appropriate. A management authority provides the necessary software software to add a node to to add a node to PlanetLab PlanetLab. A service provider registers itself with a management management authority trusting it to provide well authority, trusting it to provide wellbehaving nodes. 39PlanetLab (4) Relationships between PlanetLab entities: AA i id t t li th it t t service provider contacts a slice authority to create a slice on a collection of nodes. The The slice authority needs to authenticate the service slice authority needs to authenticate the service provider. AA node owner provides a slice creation service for a node owner provides a slice creation service for a slice authority to create slices. It essentially delegates resource management to the slice authority. A management authority delegates the creation of slices to a slice authority. 40Code Migration 41Reasons for Mig g grating Code Figure 3-17. The principle of dynamically configuring a client to communicate to a server server The client first fetches the necessary software and then invokes the server . The client first fetches the necessary software, and then invokes the server. 42Models for Code Migration Code Code Segments Segments. Resource Process Segments. consist of three

Execution St segments: Segments. 43Models for Code Migration Figure 3-18. Alternatives for code migration. 44Migration and Local Resources Figure 3-19. Actions to be taken with respect to the references to local resources when migrating code to another machine. 45Migration in Heterogeneous Systems Pushing memory pages to the new Three t gypg machine and resending the ones that are later modified during the migration process. ways to handle p Stopping the current virtual machine; migrate memory, and start the new virtual machine. migration (which Letting the new virtual machine pull in new pages as needed, that is, let processes start on the new virtual (which can be bi d) p machine immediately and copy memory pages on demand. combined) 46

Вам также может понравиться