13

Click here to load reader

5-Processes [Compatibility Mode]

Embed Size (px)

Citation preview

Page 1: 5-Processes [Compatibility Mode]

THREAD

1

Page 2: 5-Processes [Compatibility Mode]

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

Page 3: 5-Processes [Compatibility Mode]

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

Page 4: 5-Processes [Compatibility Mode]

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

Page 5: 5-Processes [Compatibility Mode]

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

Page 6: 5-Processes [Compatibility Mode]

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

Page 7: 5-Processes [Compatibility Mode]

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

Page 8: 5-Processes [Compatibility Mode]

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

Page 9: 5-Processes [Compatibility Mode]

Platforms

• Minicomputer model

• Workstation model

• Workstation-server model

• Processor-pool model

9

• Processor-pool model

• Cluster model

• Grid computing

Page 10: 5-Processes [Compatibility Mode]

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

Page 11: 5-Processes [Compatibility Mode]

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

Page 12: 5-Processes [Compatibility Mode]

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

Page 13: 5-Processes [Compatibility Mode]

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