Вы находитесь на странице: 1из 13

THREAD

Processes and threads

Process forms a building block in distributed systems Processes granularity is not sufficient for distributed systems Multiple threads make easier to build distributed applications

Thread Usage in Nondistributed Systems


large applications : many cooperating programs (processes) via Inter-Process Communication mechanisms (Unix) IPC needs extensive context switching

process B

Instead of processes : threads


3

Thread Implementation
user 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 doesnt suspend the entire process Applications dont need to know LWPs Different LWPs on different CPUs

Combining kernel-level lightweight processes and user-level threads.

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 Threads Single-threaded process Finite-state machine Characteristics Parallelism, blocking system calls No parallelism, blocking system calls 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.

Client-Side Software for Distribution Transparency


Client 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 7 solution.

Platform Milestones in Distributed Systems


1945-1950s 1950s-1960s 1960s 1960s-1970s 1969-1973 1960s-early1980s Early 1980s 1980s present 1990s Late 1990s

Loading monitor Batch system Multiprogramming Time sharing systems WAN and LAN Minicomputers Workstations Workstation/Server models Clusters Grid computing Multics, IBM360 ARPAnet, Ethernet PDP, VAX Alto Sprite, V-system Beowulf Globus, Legion
8

Platforms
Minicomputer model Workstation model Workstation-server model Processor-pool model Cluster model Grid computing

Minicomputer Model
Minicomputer Minicomputer ARPA net

Minicomputer

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

10

Workstation Model
Workstation Workstation 100Mbps LAN Workstation

Workstation

Workstation

Process migration Users first log on his/her personal workstation. If there are idle remote workstations, a heavy job may migrate to one of them. Problems: How to find am idle workstation How to migrate a job What if a user log on the remote machine 11

Workstation-Server Model
Client workstations Diskless Workstation Graphic/interactive applications processed in local All file, print, http and even cycle computation requests Workstation are sent to servers. Workstation Server minicomputers Each minicomputer is dedicated to one or more 100Gbps different types of services. LAN Client-Server model of communication RPC (Remote Procedure Call) Mini- Mini- Mini- RMI (Remote Method Invocation) A Client process calls a server process function. Computer Computer Computer No process migration invoked file server http server cycle server Example: NFS
12

Processor-Pool Model
Clients: They log in one of terminals (diskless workstations or X terminals) All services are dispatched to servers. Servers: Necessary number of processors are allocated to each user from the pool. Better utilization but less interactivity

100Mbps LAN

Server 1

Server N

13

Вам также может понравиться