Академический Документы
Профессиональный Документы
Культура Документы
Principles
p
and Paradigms
g
Second Edition
ANDREW S
S. TANENBAUM
MAARTEN VAN STEEN
Chapter 3
Processes
Processes
How the different types of processes play a crucial role in distributed
systems.
Process : a program in execution.
From an O.S. perspective, the management and scheduling of scheduling
of processes are perhaps the most important issues to deal with.
From an D.S.
To efficiently
organize
client-server
convenient
multithreading.
efficientl organi
e client
ser er ssystems,
stems con
enient to use
se m
ltithreading
Using the concept of virtualization.
The design issue of servers.
Moving processes between different machines.
Process migration or code migration.
2
Threads
What a process is
is.
How processes and threads relate.
Process Table
Table.
Independent Processes.
Concurrency Transparency.
Switching between
CPU Context.
y Management
g
Unit ((MMU).
)
Memory
Translation Lookaside Buffer (TLB).
Swap Processes.
Thread Context.
Context
Multithreading.
Several benefits to
multithreading
gp
processes.
In single-thread
process,
whenever a
blocking system
call is executed,
the process as a
whole is
blocked
blocked.
Exploit
Parallelism
Large
g
Application
Designed as a
collection of
cooperating
programs.
Large Context
Switching.
IPC in UNIX
Different Parts
executed by
separate
threads.
Shared Data
Data.
Thread switching
user space.
Software
g
g -engineering
structure as a
collection of
cooperating.
4
Figure
g
3-1. Context switching
g as the result of IPC.
5
Thread Implementation
p
Thread
Th
d
Package
Two approaches
Construct a tread library in user mode.
Kernel be aware of threads and schedule them.
User-level thread library
Advantages
Cheap to Create and Destroy threads.
Switching context can be done in few
instructions.
Disadvantages
Invocation of blocking system call will
i
immediately
di t l bl
block
k th
the entire
ti process.
Thread Implementation
p
KernelK
l
level
Threads
Sol tion
Solution:
Thread Implementation
p
Threads in Distributed
Systems
Multithreaded Clients
Conceal latencies in communication.
Initiate communication and do
something else.
Web Browsers.
10
Multithreaded Servers
Exploit
p
parallelism
to
attain high
performance.
performance
Example file
server.
Dispatcher.
p
Worker thread.
11
13
Virtualization
Single-processor illusion.
Rapidly switching between threads Create illusion
of parallelism
parallelism.
Leading to what is known as Resource Virtualization.
Virtualization
Vi
li i d
deals
l with
i h extending
di or replacing
l i an existing
i i iinterface
f
so as to mimic
i i the
h
behavior of another system.
Most important reason is to run legacy software
software.
Become less of an issue.
Then 1990s became more favored for several reasons:
15
Interfaces
at
different
levels
Interfaces
at
different
levels
CLIENTS
22
Figure
g
3-8. ((a)) A networked application
pp
with its own p
protocol.
23
Example:
p The X Window System
y
Figure 3-9.
3 9 The basic organization of the X Window System
System.
25
Servers
27
General Design
g Issues ((1))
Organi e Ser
Organize
Servers.
ers
Iterative Server.
Concurrent Server
Server.
General Design
g Issues ((2))
Whether
or not
the
server is
stateless
t t l
General Design
g Issues ((3))
Figure 3
3-11.
11. (a) Client-to-server
Client to server binding using a daemon.
30
General Design
g Issues ((4))
Figure 3-11.
3 11 (b) Client-to-server
Client to server binding using a superserver.
superserver
31
Sever Clusters
General Organization:
32
Figure 3
3-12.
12. The general organization of a
three-tiered server cluster.
33
Figure 3-13.
3 13 The principle of TCP handoff
handoff.
34
Distributed Servers
Figure
g
3-14. Route optimization
p
in a distributed server.
35
Managing
g g Server Clusters
Example: PlanetLab
Figure 3-15.
3 15 The basic organization of a PlanetLab node.
node
36
PlanetLab (1)
( )
PlanetLab management issues:
N
Nodes
d b
belong
l
tto diff
differentt organizations.
i ti
Each organization should be allowed to specify
who is allowed to run applications on their nodes
nodes,
And restrict resource usage appropriately.
Monitoring tools a
available
ailable ass
assume
me a very
er specific
combination of hardware and software.
All tailored to be used within a single organization
organization.
Programs from different slices but running on the
same node should not interfere with each other
other.
37
PlanetLab (2)
( )
PlanetLab (3)
( )
Relationships between PlanetLab entities:
A node owner puts its node under the regime of a
management authority, possibly restricting usage
where appropriate.
A management authority provides the necessary
software to add a node to PlanetLab.
PlanetLab
A service provider registers itself with a
management authority
authority, trusting it to provide well
wellbehaving nodes.
39
PlanetLab (4)
( )
Relationships between PlanetLab entities:
A service
i provider
id contacts
t t a slice
li authority
th it tto create
t
a slice on a collection of nodes.
The slice authority needs to authenticate the service
provider.
A node owner provides a slice creation service for a
slice authority to create slices. It essentially delegates
resource management to the slice authority.
A management authority delegates the creation of
slices to a slice authority.
40
Code Migration
41
Code Segments
Segments.
Process Resource
consist of
Segments.
g
three
segments: Execution
S
Segments.
t
43
44
Migration
g
and Local Resources
Figure
g
3-19. Actions to be taken with respect
p
to the references to local
resources when migrating code to another machine.
45
Pushing
g memory
yp
pages
g to the new
machine and resending the ones that
are later modified during the migration
process.
p
Stopping the current virtual machine;
migrate memory, and start the new
virtual machine.
Letting the new virtual machine pull in
new pages as needed, that is, let
processes start on the new virtual
p
machine immediately and copy memory
pages on demand.
46