Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Distributed Operating Systems CS551 Colorado State University at Lockheed-Martin Lecture 2 -- Spring 2001 CS551: Lecture 2 Topics – – – – – – – 31 January 2001 Interconnection Networks Transparencies Real Time Systems (and networks) Parallel Systems (architecture; software) Kernel of a Distributed Operating System Processes and Threads Interprocess Communication CS-551, Lecture 2 2 Interconnection networks A distributed system: “a collection of autonomous computers linked by a computer network with distributed system software” Coulouris, Dollimore & Kindberg, Distributed Systems: Concepts and Design, 2nd ed., Addison-Wesley (1994). Interconnection network designs – 31 January 2001 bus, crossbar, hypercube, shuffle-exchange CS-551, Lecture 2 3 Figure 1.8 An Interconnection Network in a Multiprocessor. (Galli,p.20) 31 January 2001 CS-551, Lecture 2 4 Interconnection network: Bus Simple, static Shared by all attached processors No routing required All data transmissions occur on bus Scalability limited by bandwidth Examples: – – 31 January 2001 Encore Multimax Sequent Balance and Sequent Symmetry CS-551, Lecture 2 5 Figure 1.9 A Bus Used as an Interconnection Network. (Galli, p.20) 31 January 2001 CS-551, Lecture 2 6 Interconnection network: Crossbar Permits dynamic configurations n memory modules x n processors Requires O(n^2) switches (expensive) Many paths from one processor to another 31 January 2001 CS-551, Lecture 2 7 Figure 1.10 A Crossbar Interconnection Network. (Galli, p.22) 31 January 2001 CS-551, Lecture 2 8 Interconnection network: Hypercube Static Requires 2^k switches for k processors Each switch is within a processor node Distance between nodes easy to compute 31 January 2001 CS-551, Lecture 2 9 Figure 1.11 A Hypercube Interconnection Network of Order 3. (Galli.p.22) 31 January 2001 CS-551, Lecture 2 10 Interconnection network: Shuffle-Exchange Permits dynamic reconfiguration Switches have four modes of operation – Simple routing – controlled by control bits in switch address bits used as control bits Examples: – 31 January 2001 Benes, Banyan, Omega, Theta CS-551, Lecture 2 11 Figure 1.12 A 2x2 Switch Box in a Shuffle-Exchange Interconnection Network. (Galli,p.23) 31 January 2001 CS-551, Lecture 2 12 Figure 1.13 A Perfect Shuffle. (Galli,p.24) 31 January 2001 CS-551, Lecture 2 13 Figure 1.14 A Multistage ShuffleExchange Interconnection Network. (Galli,p.24) 31 January 2001 CS-551, Lecture 2 14 Distributed Systems: Characteristics Shared resources Openness Concurrency Scalability Fault tolerance Transparency 31 January 2001 CS-551, Lecture 2 15 D.S. Characteristics: Openness “a characteristic that enables systems to be extended to meet new application requirements and user needs” (CDK, p.12) “achieved by specifying and documenting the key software interfaces of a system and making them available to software developers; i.e. the interfaces are published” (CDK, p.14) 31 January 2001 CS-551, Lecture 2 16 D.S. Characteristics: Transparency “the concealment from the user and from the application programmer of the separation of components in a distributed system, so that the system is perceived as a whole rather than as a collection of independent components” (CDK, p.20) Nine types: – access, location, concurrency, replication, failure, migration, name, performance, scaling 31 January 2001 CS-551, Lecture 2 17 Network transparency Network transparency = access transparency + location transparency Access transparency “enables local and remote information objects to be accessed using identical operations” (CDK, p.20) Location transparency “enables information objects to be accessed without knowledge of their location” (CDK, p.20) 31 January 2001 CS-551, Lecture 2 18 Concurrency transparency Concurrency and parallelism transparency – – – 31 January 2001 “enables several processes to operate concurrently using shared information objects without interference between them” (CDK, p.20) permits efficient use of shared resources no interference between processes sharing resources CS-551, Lecture 2 19 Replication transparency Replication transparency – – – 31 January 2001 “enables multiple instances of information objects to be used to increase reliability and performance without knowledge of the replicas by users of application programs” (CDK, p.20) may be multiple copies of files in the system updates to such files can be a problem CS-551, Lecture 2 20 Failure transparency Failure transparency – – 31 January 2001 “enables the concealment of faults, allowing users and application programs to complete their tasks despite the failure of hardware or software components” (CDK, p.20) if a site goes down, it is unapparent to other sites -- and work continues CS-551, Lecture 2 21 Migration transparency Migration transparency – – 31 January 2001 “allows the movement of information objects within a system without affecting the operation of users or application programs” (CDK, p.21) both resources and processes can migrate without users knowing CS-551, Lecture 2 22 Name transparency Name transparency – – – 31 January 2001 system incorporates a global naming scheme objects (files, resources) are not tied to given nodes or sites by name assists migration, access, and location transparencies CS-551, Lecture 2 23 Performance and Scaling transparencies Performance transparency – “allows the system to be reconfigured to improve performance as loads vary” (CDK, p.21) Scaling transparency – 31 January 2001 “allows the system and applications to expand in scale without change to the system structure or the application algorithms” (CDK, p.21) CS-551, Lecture 2 24 Distributed Operating Systems A distributed operating system is – 31 January 2001 “a collection of software components that simplifies the task of programming and supports the widest possible range of applications” (CDK, p.5) CS-551, Lecture 2 25 Kernel of an operating system The privileged portion of the OS – complete access to all resources controls – – – – 31 January 2001 process management process migration process scheduling address space CS-551, Lecture 2 26 Types of OS kernels Monolithic kernel – – Layered kernel – Unix, OS/360, VMS every node doesn’t need entire kernel in DOS Windows NT/2000, Mach, Chorus (JavaOS) Collective kernel in DOS – – 31 January 2001 O.S. services are processes microkernel supports messages between such processes CS-551, Lecture 2 27 Figure 2.1 Microkernel Design. (Galli,p.32) 31 January 2001 CS-551, Lecture 2 28 Processes Process – – – – – a program whose execution has started, but not terminated has state (ready, running, waiting) has a single address space may run serially or concurrently may interact with other processes via – shared memory message passing is a single thread of control 31 January 2001 CS-551, Lecture 2 29 Figure 2.4 Process States. (Galli,p.39) 31 January 2001 CS-551, Lecture 2 30 Threads Thread – – – – – is a lightweight process has state may share address space with other threads may run serially or concurrently interacts with other threads via shared address space message passing 31 January 2001 CS-551, Lecture 2 31 Figure 2.2 A Multithreaded Process. (Galli,p.34) 31 January 2001 CS-551, Lecture 2 32 Issues with processes and threads Shared memory space – – no protection barrier to other processes/threads need to maintain integrity Synchronized access – – 31 January 2001 must enforce mutual exclusion code that accesses a shared resource must be a critical section CS-551, Lecture 2 33 Multi-threaded systems Three models – – – specialist -- all threads equal client/server -- server allots tasks to clients assembly line -- like a pipeline Supporting – – 31 January 2001 POSIX Java CS-551, Lecture 2 34 Figure 2.3 Multithreaded Process Paradigms. (Galli,p.35) 31 January 2001 CS-551, Lecture 2 35 Why threads? Processes – to create or destroy a process is expensive requires – to restore or swap out a process is expensive requires more memory space memory map changes Threads – – 31 January 2001 can keep a pool of threads and reuse them memory space is shared and need not always be swapped CS-551, Lecture 2 36 Process management Controls process (or thread) and its components Recall PCB (Process Control Block) – – – – – – 31 January 2001 process id process state process priority process privileges virtual memory address recorded statistics for account CS-551, Lecture 2 37 Figure 2.4 Process States. (Galli,p.39) 31 January 2001 CS-551, Lecture 2 38 Processes, continued Indivisible – – Divisible – – – independent not divisible into smaller tasks may be broken up into smaller processes (tasks) subtasks may run on different nodes helps to balance load of distributed system Task Interaction Graphs (TIG) 31 January 2001 CS-551, Lecture 2 39 Example of TIG TIG shows precedence of subtasks – – – – – – 31 January 2001 T1 -- Prepare main course T2 -- Prepare side dishes T3 -- Prepare dessert T4 -- Set table T5 -- Serve meal T6 -- Serve dessert CS-551, Lecture 2 40 Figure 2.5 TIG Revealing Precedence Relationships. (Galli,p.42) 31 January 2001 CS-551, Lecture 2 41 Load Distribution Goal – Load balancing – to balance the load equally among resources Load sharing – to utilize resources in an efficient manner to relieve overloaded resources Process migration – 31 January 2001 to move a process to another processor CS-551, Lecture 2 42 Load distribution algorithms Two parts Information-gathering – status states (site is overloaded/underutilized?) Process selection – – – 31 January 2001 which process/thread/task to migrate? expected overhead for migration? expected execution time? CS-551, Lecture 2 43 Heterogeneous environments May include different data representations – process migration may require data translation External data representation – 31 January 2001 common data representation between sites CS-551, Lecture 2 44 Figure 2.6 Data Translation without External Data Representation. (Galli, p.44) 31 January 2001 CS-551, Lecture 2 45 Figure 2.7 Data Translation with External Data Representation. (Galli,p.44) 31 January 2001 CS-551, Lecture 2 46 Process Scheduling Recall from Operating Systems course Problem: #2.10 in textbook Identifying schedulable tasks – – – 31 January 2001 polled loop interrupts gang scheduling CS-551, Lecture 2 47 Figure 2.8 Polled-Loop Example. (Galli,p.47) 31 January 2001 CS-551, Lecture 2 48 Figure 2.9 Smart Concurrent Scheduling. (Galli,p.48) 31 January 2001 CS-551, Lecture 2 49 Figure 2.10 Scheduling. 31 January 2001 Blind Concurrent (Galli,p.48) CS-551, Lecture 2 50 Remote procedure calls (RPC) 31 January 2001 CS-551, Lecture 2 51 Figure 3.9 Remote Procedure Call Stubs. (Galli,p.73) 31 January 2001 CS-551, Lecture 2 52 Figure 3.10 Establishing Communication for RPC. (Galli,p.74) 31 January 2001 CS-551, Lecture 2 53