Figure 15.1 A distributed multimedia system

Download Report

Transcript Figure 15.1 A distributed multimedia system

Slides for Chapter 6:
Operating System support
From Coulouris, Dollimore and Kindberg
Distributed Systems:
Concepts and Design
Edition 3, © Addison-Wesley 2001
Figure 6.1
System layers
Applications, services
Middlew are
OS: kernel,
libraries &
servers
OS1
Process es , threads,
communic ation, ...
OS2
Process es , threads,
communic ation, ...
Computer &
netw ork hardw are
Computer &
netw ork hardw are
Node 1
Node 2
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Platform
Figure 6.2
Core OS functionality
Proc es s manager
Communic ation
manager
Thread manager
Memory manager
Supervisor
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.3
Address space
2N
Auxiliary
regions
Stac k
Heap
Tex t
0
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.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 and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.5
Client and server with threads
Thread 2 makes
requests to server
Thread 1
generates
results
Input-output
Receipt &
queuing
T1
Requests
N threads
Client
Server
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.6
Alternative server threading architectures (see also Figure 6.5)
per-c onnection threads
w orkers
I/O
remote
objec ts
a. Thread-per-request
remote
objec ts
b. Thread-per-connec tion
per-objec t threads
I/O
remote
objec ts
c . Thread-per-object
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.7
State associated with execution environments and threads
Execution environment
Address space tables
Communication interfaces, open files
Thread
Saved processor registers
Priority and execution state (such as
BLOCKED)
Software interrupt handling information
Semaphores, other synchronization
objects
List of thread identifiers
Execution environment identifier
Pages of address space resident in memory; hardware cache entries
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.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()
Enter the READY state and invoke the scheduler.
destroy()
Destroy the thread.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.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 and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.10
Scheduler activations
Process
A
P added
SA preempted
Process
B
Process
SA unblocked
SA blocked
Kernel
Kernel
Virtual proc es sors
P idle
P needed
A. As signment of v irtual proc es sors
to process es
B. Ev ents betw een user-level s cheduler & kernel
Key: P = proc es sor; SA = s cheduler ac tiv ation
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.11
Invocations between address spaces
(a) Sy stem c all
Control trans fer v ia
trap instruction
Thread
Control trans fer v ia
priv ileged instruc tions
Us er
Kernel
Protection domain
boundary
(b) RPC/RMI (w ithin one computer)
Thread 1
Us er 1
Thread 2
Kernel
Us er 2
(c ) RPC/RMI (betw een computers )
Netw ork
Thread 1
Thread 2
Us er 1
Us er 2
Kernel 1
Kernel 2
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.12
RPC delay against parameter size
RPC delay
Reques ted data
s iz e (bytes )
0
1000
2000
Pac ket
s iz e
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.13
A lightweight remote procedure call
Client
Server
A s tack
4. Ex ec ute proc edure
and copy res ults
1. Copy args
Us er
A
stub
stub
Kernel
2. Trap to Kernel
3. Upcall
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
5. Return (trap)
Figure 6.14
Times for serialized and concurrent invocations
Serialised inv oc ations
process args
mars hal
Send
Receiv e
unmars hal
process results
process args
mars hal
Send
Conc urrent invocations
process args
mars hal
Send
trans mis sion
process args
mars hal
Send
Receiv e
unmars hal
ex ec ute reques t
mars hal
Send
Receiv e
unmars hal
process results
Receiv e
unmars hal
ex ec ute reques t
mars hal
Send
Receiv e
unmars hal
ex ec ute reques t
mars hal
Send
Receiv e
unmars hal
process results
Receiv e
unmars hal
ex ec ute reques t
mars hal
Send
time
Receiv e
unmars hal
process results
Client
Server
Client
Server
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.15
Monolithic kernel and microkernel
S4
.......
S1
S1
Key:
Server:
S2
S3
S2
S3
S4
.......
.......
Monolithic Kernel
Kernel code and data:
Mic rokernel
Dy namic ally loaded s erv er program:
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 6.16
The role of the microkernel
Middlew are
Language
support
subs ys tem
Language
support
subs ys tem
OS emulation
subs ys tem
Mic rokernel
Hardw are
The micro kernel su pports midd leware v ia sub sys tems
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
....