Figure 15.1 A distributed multimedia system

Download Report

Transcript Figure 15.1 A distributed multimedia system

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
Applic ations, s ervic es
Middleware
OS: kernel,
li braries &
s ervers
OS1
Proc ess es , threads,
c ommunic ati on, ...
OS2
Proc ess es , threads,
c ommunic ati on, ...
Computer &
network hardware
Computer &
network hardware
Node 1
Node 2
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
© Pearson Education 2012
Platform
Figure 7.2
Core OS functionality
Proc ess manager
Communic ati on
manager
T hread manager
Memory manager
Supervis or
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
© Pearson Education 2012
Figure 7.3
Address space
2N
Auxiliary
regi ons
Stac k
Heap
T ext
0
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
© Pearson Education 2012
Figure 7.4
Copy-on-write
Process A’s address space
RA
Process B’s address space
RB copied
from RA
RB
Kernel
A's page
table
Shared
frame
B's page
table
a) Before write
b) After write
Instructor’s 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
Input-output
Receipt &
queuing
Thread 1
generates
results
T1
Requests
N threads
Client
Server
Instructor’s 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)
workers
I/O
remote
objects
a. T hread-per-reques t
per-connec tion threads
remote
objects
b. T hread-per-c onnecti on
per-objec t threads
I/O
remote
objects
c . T hread-per-object
Instructor’s 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
Instructor’s 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 thread’s 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.
Instructor’s 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.
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
© Pearson Education 2012
Figure 7.10
Scheduler activations
Proc ess
A
P added
SA preempted
Proc ess
B
Proc ess
SA unbloc ked
SA blocked
Kernel
Virtual proc ess ors
A. Ass ignment of virtual proc es sors
to proc ess es
Kernel
P idle
P needed
B. Events between user-l evel sc heduler & kernel
Key: P = proc es sor; SA = s chedul er ac tivation
Instructor’s 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) Sys tem call
Control transfer via
trap instruc tion
T hread
Control transfer via
privi leged i ns tructions
User
Kernel
Protec tion domain
boundary
(b) RPC/RMI (wi thi n one c omputer)
T hread 1
User 1
T hread 2
Kernel
User 2
(c ) RPC/RMI (between computers)
Network
T hread 1
T hread 2
User 1
User 2
Kernel 1
Kernel 2
Instructor’s 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 del ay
Requested data
s ize (bytes )
0
1000
2000
Pac ket
s ize
Instructor’s 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
Server
A s tack
4. Execute proc edure
and copy results
1. Copy args
User
A
s tub
s tub
Kernel
2. T rap to Kernel
3. Upc al l
5. Return (trap)
Instructor’s 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
Seri al ised invoc ations
proc es s args
marshal
Send
Rec ei ve
unmarshal
proc es s results
proc es s args
marshal
Send
Conc urrent i nvoc ati ons
proc es s args
marshal
Send
transmis si on
proc es s args
marshal
Send
Rec ei ve
unmarshal
exec ute reques t
marshal
Send
Rec ei ve
unmarshal
proc es s results
Rec ei ve
unmarshal
exec ute reques t
marshal
Send
Rec ei ve
unmarshal
exec ute reques t
marshal
Send
Rec ei ve
unmarshal
proc es s results
Rec ei ve
unmarshal
exec ute reques t
marshal
Send
ti me
Rec ei ve
unmarshal
proc es s results
Client
Server
Client
Server
Instructor’s 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
S1
Key:
Server:
S2
S3
S2
S3
S4
.......
.......
Monol ithic Kernel
Kernel c ode and data:
Microkernel
Dynamic al ly l oaded server program:
Instructor’s 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
s upport
s ubsystem
Language
s upport
s ubsystem
OS emulation
s ubsystem
Microkernel
Hardware
The microkernel support s mi ddleware vi a subsyst ems
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
© Pearson Education 2012
.. ..
Figure 7.17
The architecture of Xen
Instructor’s 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
Instructor’s 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
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
© Pearson Education 2012
20
Figure 7.20
Split device drivers
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
© Pearson Education 2012
21
Figure 7.21
I/O rings
Instructor’s 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
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
© Pearson Education 2012
23