Click here to load reader
Upload
akhil-sharma
View
215
Download
0
Embed Size (px)
Citation preview
THREAD
1
Processes and threads
• Process forms a building block in distributed systems
• Processes granularity is not sufficient for distributed
systemssystems
• Multiple threads make easier to build distributed
applications
2
Thread Usage in Nondistributed Systemslarge applications : many cooperating programs (processes) via
Inter-Process Communication mechanisms (Unix)
IPC needs extensive context switching
Instead of processes : threads
process Bprocess B
3
Thread Implementationuser level library: switching in a few instructions, no change in memory maps etc. but a
blocking system call blocks the entire process
O.S. kernel level : no problem with blocking system call but every thread operation has
to be carried out by the kernel, so switching contest similar to process
LightWeight Processes (LWP)
•Manipulation of threads at user level
•A blocking call doesn’t suspend the entire
Combining kernel-level lightweight processes and user-level threads.
•A blocking call doesn’t suspend the entire
process
•Applications don’t need to know LWPs
•Different LWPs on different CPUs
4
Multithreaded Servers The true benefit from multithreading in DS is having multithreaded servers
A multithreaded server (i.e. file server) organized in a dispatcher/worker model.
5
Multithreaded Servers
Model Characteristics
Threads Parallelism, blocking system calls
Single-threaded process No parallelism, blocking system calls
Finite-state machine Parallelism, nonblocking system calls
Three ways to construct a server:
The multi- and single-threaded models are “sequential” and synchronous
The finite-state machine model is asynchronous and simulates the multi-threaded
model; instead of blocking, it records the request and gets the next message. Not a
sequential process, hard to program.
Finite-state machine Parallelism, nonblocking system calls
6
Client-Side Software for Distribution TransparencyClient software is a lot more than user interfaces
Access, location, migration, replication, failure transparency:
cooperation with client-side software
A possible approach to transparent replication of a remote object using a client-side solution. 7
Platform Milestones in Distributed
Systems
1945-1950s Loading monitor
1950s-1960s Batch system
1960s Multiprogramming
1960s-1970s Time sharing systems Multics, IBM360
8
1960s-1970s Time sharing systems Multics, IBM360
1969-1973 WAN and LAN ARPAnet, Ethernet
1960s-early1980s Minicomputers PDP, VAX
Early 1980s Workstations Alto
1980s – present Workstation/Server models Sprite, V-system
1990s Clusters Beowulf
Late 1990s Grid computing Globus, Legion
Platforms
• Minicomputer model
• Workstation model
• Workstation-server model
• Processor-pool model
9
• Processor-pool model
• Cluster model
• Grid computing
Minicomputer Model
Mini-
computer
Mini- Mini-ARPA
10
• Extension of Time sharing system
– User must log on his/her home minicomputer.
– Thereafter, he/she can log on a remote machine by telnet.
• Resource sharing
– Database
– High-performance devices
Mini-
computerMini-
computernet
Workstation Model
100Mbps
LAN
Workstation
Workstation Workstation
11
• Process migration
– Users first log on his/her personal workstation.
– If there are idle remote workstations, a heavy job may migrate toone of them.
• Problems:
– How to find am idle workstation
– How to migrate a job
– What if a user log on the remote machine
WorkstationWorkstation
Workstation-Server Model
• Client workstations
– Diskless
– Graphic/interactive applications processed in local
– All file, print, http and even cycle computation requestsare sent to servers.
• Server minicomputers
Workstation
Workstation Workstation
12
• Server minicomputers
– Each minicomputer is dedicated to one or moredifferent types of services.
• Client-Server model of communication
– RPC (Remote Procedure Call)
– RMI (Remote Method Invocation)
• A Client process calls a server process’ function.
• No process migration invoked
• Example: NFS
100Gbps
LAN
Mini-
Computerfile server
Mini-
Computerhttp server
Mini-
Computercycle server
Processor-Pool Model
• Clients:
– They log in one of terminals (diskless
workstations or X terminals)
– All services are dispatched to servers.
13
• Servers:
– Necessary number of processors are
allocated to each user from the pool.
• Better utilization but less interactivity
Server 1
100Mbps
LAN
Server N