Escolar Documentos
Profissional Documentos
Cultura Documentos
Introduction
The operation system layer
Protection
Processes and threads
Communication and invocation
Operating system architecture
Summary
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
6.1 Introduction
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Introduction (2)
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Introduction (4) --Middleware and network operating systems
Applications, services
Middleware
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
The operating system layer
exceptions
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
6.3 Protection
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
6.4.1 Address spaces
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
Stack
Heap
Text
0
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
6.4.1 Address spaces (2)
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Choice of process host (3)
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
6.4.3 Threads
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
Worker pool
Thread 2 makes
requests to server
Receipt & Input-output
queuing
Thread 1
generates
results
T1
Requests
N threads
Client
Server
Advantage: thethe
Disadvantage: threads In each
Their of these lastistwo
disadvantage thatarchitectures
clients may be
do not contend
overheads of thefor a
thread the server
delayed benefits
while fromthread
a worker loweredhasthread-
shared queue,
creation and
and destruction management
several overheads
outstanding compared
requests with
but another
throughput is potentially
operations the thread-per-request
thread architecture.
has no work to perform
maximized 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
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
A comparison of processes and threads as follows
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
A context switch is the transition between contexts
that takes place when switching between threads, or
when a single thread makes a system call or takes
another type of exception
It involves the following:
The saving of the processor’s original register state, and
loading of the new state
In some cases; a transfer to a new protection domain –
this is known as a domain transition
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Thread scheduling
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Thread implementation
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Thread implementation (2)
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
The four type of event that kernel notified to the user-level scheduler
P added
Process Process
A B SA preempted
Process SA unbloc ked
SA blocked
Kernel
P idle
Virtual processors Kernel
P needed
A. Assignment of virtual proc essors B. Events between user-level scheduler & kernel
to processes Key: P = proc essor; SA = scheduler activation
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
Protection domain
(b) RPC/RMI (within one computer) boundary
Thread 1 Thread 2
User 1 User 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
Client delay against requested
data size. The delay is roughly
proportional to the size until the
size reaches a threshold at about
network packet size
Requested data
size (bytes)
0 1000 2000
Packet
size
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
The following are the main components accounting for remote invocation delay,
besides network transmission times
Marshalling
Data copying
Packet initialization
Thread scheduling and context switching
Waiting for acknowledgements
1.Marshalling
Potentially,
Several
This and
even
system
The involves
choice of unmarshalling,
after marshalling,
calls (that
initializing
RPC which
is, context
protocol
protocol
may involve
message andcopying
data
switches)
headers isare
copied
madeand
several
duringtimes
an
converting
in the as
RPC,
trailers,
influence data,
course
stubs
includingbecome
ofinvokes
delay, a significant
anparticularly
RPCthe
checksums.kernel’s overhead
The communication
when cost
large as theoperations
is therefore amount of
data grows of data
proportional,
amounts in part,
arethreads
sent
toboundary,
the is
amount of datathe
sent
1.
2. Across the user-kernel
One or more server between
scheduled client or server address
space and kernel buffers
3. If the operating system employs a separate network manager process,
2. Across each
then each protocol
Send layer
involves (for example,
a context switch RPC/UDP/IP/Ethernet)
to one of its threads
3. Between the network interface and kernel buffers
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
A lightweight remote procedure call
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 stack
A
Kernel
2. Trap to Kernel 3. Upcall 5. Return (trap)
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
6.5.2 Asynchronous operation
pipelining
process args process args
marshal marshal
Send transmission Send
process args
marshal
Receive Send Receive
unmarshal unmarshal
execute request execute request
marshal marshal
Send Send
Receive
unmarshal
Receive Receive execute request
unmarshal unmarshal marshal
process results process results Send
process args
marshal Receive
Send
unmarshal
process results
Receive time
unmarshal
execute request
marshal
Send
Receive
unmarshal
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
6.6 Operating system architecture
S1 S2 S3 S4 .......
.......
S1 S2 S3
Middleware
Microkernel
Hardware
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Comparison
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000