Anda di halaman 1dari 23

Slides for Chapter 7: Operating System support

From Coulouris, Dollimore, Kindberg and Blair

Distributed Systems: Concepts and Design


Edition 5, Addison-Wesley 2012

Figure 7.1 System layers

Applications, serv ic es Middleware

OS: kernel, libraries & serv ers

OS1 Proc es ses, threads , communication, ... Computer & network hardware Node 1

OS2 Proc es ses, threads , communication, ... Computer & network hardware Node 2

Platf orm

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.2 Core OS functionality

Proc es s manager

Communic ation manager

Thread m anager Superv is or

Memory manager

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.3 Address space

2N

Auxiliary regions

Stac k

Heap

Text 0

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.4 Copy-on-write

Process As address space

Process Bs address space

RA

RB copied from RA

RB

Kernel Shared frame


B's page table

A's page table

a) Before write

b) After write

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.5 Client and server with threads

Thread 2 makes requests to server Thread 1 generates results Receipt & queuing

Input-output

T1 Requests N threads Client Server

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.6 Alternative server threading architectures (see also Figure 7.5)

work ers I/O remote objec ts

per-c onnec tion threads

per-objec t threads I/O remote objec ts

remote objec ts

a. Thread-per-request

b. Thread-per-c onnection

c. Thread-per-objec t

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.7 State associated with execution environments and threads

Execution environment Thread Address space tables Saved processor registers Communication interfaces, open files Priority and execution state (such as BLOCKED) Semaphores, other synchronization Software interrupt handling information objects List of thread identifiers Execution environment identifier Pages of address space resident in memory; hardware cache entries

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.8 Java thread constructor and management methods


Thread(ThreadGroup group, Runnable target, String name) Creates a new thread in the SUSPENDED state, which will belong to group and be identified as name; the thread will execute the run() method of target. setPriority(int newPriority), getPriority() Set and return the threads priority. run() A thread executes the run() method of its target object, if it has one, and otherwise its own run() method (Thread implements Runnable). start() Change the state of the thread from SUSPENDED to RUNNABLE. sleep(int millisecs) Cause the thread to enter the SUSPENDED state for the specified time. yield() Causes the thread to enter the READY state and invoke the scheduler. destroy() Destroy the thread.
Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.9 Java thread synchronization calls

thread.join(int millisecs) Blocks the calling thread for up to the specified time until thread has terminated. thread.interrupt() Interrupts thread: causes it to return from a blocking method call such as sleep(). object.wait(long millisecs, int nanosecs) Blocks the calling thread until a call made to notify() or notifyAll() on object wakes the thread, or the thread is interrupted, or the specified time has elapsed. object.notify(), object.notifyAll() Wakes, respectively, one or all of any threads that have called wait() on object.

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.10 Scheduler activations

Proc es s A

Proc es s B Proc es s Kernel

P added SA preempted SA unblock ed SA block ed

Virtual proc ess ors

Kernel

P idle P needed

A. Ass ignm ent of v irtual proc es sors to process es

B. Ev ents between user-lev el scheduler & kernel Key : P = proces sor; SA = sc heduler activ ation

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.11 Invocations between address spaces


(a) Sy stem c all Thread Control trans fer v ia trap instruc tion Control trans fer v ia priv ileged ins truc tions Us er Kernel Protec tion domain boundary

(b) R PC/RMI (within one c omputer)

Thread 1

Thread 2

Us er 1
(c) R PC/RMI (between computers)

Kernel

Us er 2

Thread 1

Network

Thread 2

Us er 1 Kernel 1 Kernel 2

Us er 2

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.12 RPC delay against parameter size

RPC delay

Requested data size (by tes ) 0 1000 Pack et size 2000

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.13 A lightweight remote procedure call

Client

Serv er

A stac k

A 4. Ex ecute proc edure and copy res ults

1. Copy args

Us er Kernel

stub

stub

2. Trap to Kernel

3. Upc all

5. Return (trap)

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.14 Times for serialized and concurrent invocations


Serialis ed inv ocations proces s args mars hal Send Concurrent inv ocations

proces s args mars hal Send trans mis sion proces s args mars hal Send Receiv e unmarshal ex ec ute reques t mars hal Send Receiv e unmarshal proces s results Receiv e unmarshal proces s results Receiv e unmarshal ex ec ute reques t mars hal Send

Receiv e unmarshal proces s results proces s args mars hal Send

Receiv e unmarshal ex ec ute reques t mars hal Send Receiv e unmarshal ex ec ute reques t mars hal Send

tim e

Receiv e unmarshal proces s results Client Serv er Client Serv er

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.15 Monolithic kernel and microkernel

S4

....... S1 S2 S3 S4 .......

S1

S2

S3

.......

Key : Serv er:

Monolithic Kernel

Microk ernel

Kernel c ode and data:

Dy namic ally loaded s erv er program:

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.16 The role of the microkernel

Middleware Language support subs y stem Language support subs y stem Microkernel Hardware OS emulation subs y stem

....

The microkernel support s middleware via subsystems

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

Figure 7.17 The architecture of Xen

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

18

Figure 7.18 Use of rings of privilege

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

19

Figure 7.19 Virtualization of memory management

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

20

Figure 7.20 Split device drivers

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

21

Figure 7.21 I/O rings

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

22

Figure 7.22 The XenoServer Open Platform Architecture

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 Pearson Education 2012

23

Anda mungkin juga menyukai