SlideShare a Scribd company logo
1 of 22
1
Chapter 3 - Processes
2
Introduction
 communication takes place between processes
 a process is a program in execution
 from OS perspective, management and scheduling of
processes is important
 other important issues arise in distributed systems
 multithreading to enhance performance
 how are clients and servers organized
 process or code migration to achieve scalability and to
dynamically configure clients and servers
3
3.1 Threads and their Implementation
 threads can be used in both distributed and nondistributed
systems
 Threads in Nondistributed Systems
 a process has an address space (containing program text
and data) and a single thread of control, as well as other
resources such as open files, child processes, accounting
information, etc.
Process 1 Process 2 Process 3
three processes each with one thread one process with three threads
4
 each thread has its own program counter, registers, stack,
and state; but all threads of a process share address space,
global variables and other resources such as open files, etc.
5
 Threads take turns in running
 Threads allow multiple executions to take place in the same
process environment, called multithreading
 Thread Usage – Why do we need threads?
 e.g., a word processor has different parts; parts for
 interacting with the user
 formatting the page as soon as changes are made
 timed savings (for auto recovery)
 spelling and grammar checking, etc.
1. Simplifying the programming model: since many
activities are going on at once
2. They are easier to create and destroy than processes
since they do not have any resources attached to them
3. Performance improves by overlapping activities if there is
too much I/O; i.e., to avoid blocking when waiting for
input or doing calculations, say in a spreadsheet
4. Real parallelism is possible in a multiprocessor system
6
 having finer granularity in terms of multiple threads per
process rather than processes provides better performance
and makes it easier to build distributed applications
 in nondistributed systems, threads can be used with shared
data instead of processes to avoid context switching
overhead in interprocess communication (IPC)
context switching as the result of IPC
process A to process B
7
 Threads in Distributed Systems
 Multithreaded Clients
 consider a Web browser; fetching different parts of a page
can be implemented as a separate thread, each opening its
own TCP/IP connection to the server or to separate and
replicated servers
 each can display the results as it gets its part of the page
 Multithreaded Servers
 servers can be constructed in three ways
1.single-threaded process
 it gets a request, examines it, carries it out to completion
before getting the next request
 the server is idle while waiting for disk read, i.e., system
calls are blocking
8
2. threads
 threads are more important for implementing servers
 e.g., a file server
 the dispatcher thread reads incoming requests for a file
operation from clients and passes it to an idle worker
thread
 the worker thread performs a blocking disk read; in
which case another thread may continue, say the
dispatcher or another worker thread
a multithreaded server organized in a dispatcher/worker model
9
3. finite-state machine
 if threads are not available
 it gets a request, examines it, tries to fulfill the request
from cache, else sends a request to the file system; but
instead of blocking it records the state of the current
request and proceeds to the next request
 Summary
three ways to construct a server
Model Characteristics
Single-threaded process No parallelism, blocking system calls
Threads
Parallelism, blocking system calls
(thread only)
Finite-state machine Parallelism, nonblocking system calls
10
 Two issues: user interfaces and client-side software for
distribution transparency(reading assignment)
1. User Interfaces
 to create a convenient environment for the interaction of a
human user and a remote server; e.g. mobile phones with
simple displays and a set of keys
 GUIs are most commonly used
 The X Window System (or simply X)
 it has the X-kernel: the part of the OS that controls the
terminal (monitor, keyboard, pointing device like a
mouse)
 contains all terminal-specific device drivers through the
library called xlib
3.2 Anatomy of Clients
11
the basic organization of the X Window System
12
 issues
 how to organize servers?
 where do clients contact a server?
 whether and how a server can be interrupted
 whether or not the server is stateless
1. how to organize servers?
 iterative server
 the server itself handles the request and returns the
result
 concurrent server
 it passes a request to a separate process or thread and
waits for the next incoming request; e.g., a
multithreaded server
3.3 Servers: General Design Issues
13
2. where do clients contact a server?
 using endpoints or ports at the machine where the server
is running where each server listens to a specific
endpoint
 how do clients know the endpoint of a service?
 globally assign endpoints for well-known services; e.g.
FTP is on TCP port 21, HTTP is on TCP port 80
 for services that do not require preassigned endpoints,
it can be dynamically assigned by the local OS
 how can the client know this endpoint? two
approaches
a. have a daemon running and listening to a well-known
endpoint like in DCE; it keeps track of all endpoints of
services on the collocated server
 the client will first contact the daemon which
provides it with the endpoint, and then the client
contacts the specific server
14
Client-to-server binding using a daemon as in DCE
B 15
3. whether and how a server can be interrupted
 for instance, a user may want to interrupt a file transfer,
may be it was the wrong file
 let the client exit the client application; this will break the
connection to the server; the server will tear down the
connection assuming that the client had crashed
or
 let the client send out-of-bound data, data to be
processed by the server before any other data from the
client; the server may listen on a separate control
endpoint; or send it on the same connection as urgent
data as is in TCP
4. whether or not the server is stateless
 a stateless server does not keep information on the state
of its clients; for instance a Web server
 a stateful server maintains information about its clients;
for instance a file server that allows a client to keep a
local copy of a file and can make update operations
16
 so far, communication was concerned on passing data
 we may pass programs, even while running and in
heterogeneous systems
 code migration also involves moving data as well: when a
program migrates while running, its status, pending signals,
and other environment variables such as the stack and the
program counter also have to be moved
3.4 Code Migration
1. Reasons for Migrating Code
 to improve performance; move processes from heavily-
loaded to lightly-loaded machines (load balancing)
 to reduce communication: move a client application that
performs many database operations to a server if the
database resides on the server; then send only results to the
client
 to exploit parallelism (for nonparallel programs): e.g., copies
of a mobile program moving from site to site searching the
Web
17
2. Models for Code Migration
 a process consists of three segments: code segment (set of
instructions), resource segment (references to external
resources such as files, printers, ...), and execution segment
(to store the current execution state of a process such as
private data, the stack, the program counter)
 Weak Mobility
 transfer only the code segment and may be some
initialization data; in this case a program always starts
from its initial stage, e.g. Java Applets
 execution can be by the target process (in its own
address space like in Java Applets) or by a separate
process
18
 Strong Mobility
 transfer code and execution segments; helps to migrate a
process in execution
 can also be supported by remote cloning; having an
exact copy of the original process and running on a
different machine; executed in parallel to the original
process; UNIX does this by forking a child process
 migration can be
 sender-initiated: the machine where the code resides or
is currently running; e.g., uploading programs to a
server; may need authentication or that the client is a
registered one
 receiver-initiated: by the target machine; e.g., Java
Applets; easier to implement
19
 Summary of models of code migration
alternatives for code migration
20
3. Migration and Local Resources
 how to migrate the resource segment
 not always possible to move a resource; e.g., a reference to
TCP port held by a process to communicate with other
processes
 Types of Process-to-Resource Bindings
 Binding by identifier (the strongest): a resource is referred
by its identifier; e.g., a URL to refer to a Web page or an FTP
server referred by its Internet address
 Binding by value (weaker): when only the value of a
resource is needed; in this case another resource can
provide the same value; e.g., standard libraries of
programming languages such as C or Java which are
normally locally available, but their location in the file
system may vary from site to site
 Binding by type (weakest): a process needs a resource of a
specific type; reference to local devices, such as monitors,
printers, ...
21
 how can a reference be changed? depends whether the
resource can be moved along with the code, i.e., resource-to-
machine binding
 Types of Resource-to-Machine Bindings
 Unattached Resources: can be easily moved with the
migrating program (such as data files associated with the
program)
 Fastened Resources: such as local databases and complete
Web sites; moving or copying may be possible, but very
costly
 Fixed Resources: intimately bound to a specific machine or
environment such as local devices and cannot be moved
we have nine combinations to consider
22
actions to be taken with respect to the references to local resources
when migrating code to another machine
Unattached Fastened Fixed
By identifier
By value
By type
MV (or GR)
CP (or MV, GR)
RB (or GR, CP)
GR (or MV)
GR (or CP)
RB (or GR, CP)
GR
GR
RB (or GR)
Resource-to machine binding
Process-to-
resource binding
 GR: Establish a global system wide reference
 MV: Move the resource
 CP: Copy the value of the resource
 RB: Rebind process to a locally available resource
 Exercise: for each of the nine combinations, give example
resources

More Related Content

What's hot

Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed systemSunita Sahu
 
Remote invocation
Remote invocationRemote invocation
Remote invocationishapadhy
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing modelsishmecse13
 
Vector clock algorithm
Vector clock algorithmVector clock algorithm
Vector clock algorithmS. Anbu
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure callSunita Sahu
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmpinki soni
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemDHIVYADEVAKI
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptxAcad
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computingSVijaylakshmi
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemorySHIKHA GAUTAM
 
CS9222 Advanced Operating System
CS9222 Advanced Operating SystemCS9222 Advanced Operating System
CS9222 Advanced Operating SystemKathirvel Ayyaswamy
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitivesStudent
 
Client Centric Consistency Model
Client Centric Consistency ModelClient Centric Consistency Model
Client Centric Consistency ModelRajat Kumar
 

What's hot (20)

Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Remote invocation
Remote invocationRemote invocation
Remote invocation
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing models
 
Distributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query ProcessingDistributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query Processing
 
Vector clock algorithm
Vector clock algorithmVector clock algorithm
Vector clock algorithm
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
 
CS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMSCS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMS
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithm
 
Quality of Service
Quality of ServiceQuality of Service
Quality of Service
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed System
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
 
CS9222 Advanced Operating System
CS9222 Advanced Operating SystemCS9222 Advanced Operating System
CS9222 Advanced Operating System
 
Message passing in Distributed Computing Systems
Message passing in Distributed Computing SystemsMessage passing in Distributed Computing Systems
Message passing in Distributed Computing Systems
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitives
 
Client Centric Consistency Model
Client Centric Consistency ModelClient Centric Consistency Model
Client Centric Consistency Model
 
Stream oriented communication
Stream oriented communicationStream oriented communication
Stream oriented communication
 

Similar to Chapter 3-Processes.ppt

distributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptxdistributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptxlencho3d
 
Task communication
Task communicationTask communication
Task communication1jayanti
 
Application server
Application serverApplication server
Application servernava rathna
 
Lec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfLec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfsamaghorab
 
Chapter 4 communication2
Chapter 4 communication2Chapter 4 communication2
Chapter 4 communication2DBU
 
Client Server Model and Distributed Computing
Client Server Model and Distributed ComputingClient Server Model and Distributed Computing
Client Server Model and Distributed ComputingAbhishek Jaisingh
 
Introduction to the client server computing By Attaullah Hazrat
Introduction to the client server computing By Attaullah HazratIntroduction to the client server computing By Attaullah Hazrat
Introduction to the client server computing By Attaullah HazratAttaullah Hazrat
 
CHP-4.pptx
CHP-4.pptxCHP-4.pptx
CHP-4.pptxFamiDan
 
Peoplesoft PIA architecture
Peoplesoft PIA architecturePeoplesoft PIA architecture
Peoplesoft PIA architectureAmit rai Raaz
 
Lecture5 architecture styles.pdf
Lecture5 architecture styles.pdfLecture5 architecture styles.pdf
Lecture5 architecture styles.pdfssuser9d62d6
 
Linux Inter Process Communication
Linux Inter Process CommunicationLinux Inter Process Communication
Linux Inter Process CommunicationAbhishek Sagar
 
Chapter 2B-Communication.ppt
Chapter 2B-Communication.pptChapter 2B-Communication.ppt
Chapter 2B-Communication.pptsirajmohammed35
 
Server and Its Types - Presentation
Server and Its Types - PresentationServer and Its Types - Presentation
Server and Its Types - PresentationShakeel Haider
 
Internetworking
InternetworkingInternetworking
InternetworkingRaghu nath
 

Similar to Chapter 3-Processes.ppt (20)

Chapter 3-Processes2.pptx
Chapter 3-Processes2.pptxChapter 3-Processes2.pptx
Chapter 3-Processes2.pptx
 
distributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptxdistributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptx
 
Task communication
Task communicationTask communication
Task communication
 
Application server
Application serverApplication server
Application server
 
Internet
InternetInternet
Internet
 
Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
Lec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfLec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdf
 
Chapter 4 communication2
Chapter 4 communication2Chapter 4 communication2
Chapter 4 communication2
 
Client Server Model and Distributed Computing
Client Server Model and Distributed ComputingClient Server Model and Distributed Computing
Client Server Model and Distributed Computing
 
Clientserver
ClientserverClientserver
Clientserver
 
Introduction to the client server computing By Attaullah Hazrat
Introduction to the client server computing By Attaullah HazratIntroduction to the client server computing By Attaullah Hazrat
Introduction to the client server computing By Attaullah Hazrat
 
CHP-4.pptx
CHP-4.pptxCHP-4.pptx
CHP-4.pptx
 
CN UNIT V.pptx
CN UNIT V.pptxCN UNIT V.pptx
CN UNIT V.pptx
 
Peoplesoft PIA architecture
Peoplesoft PIA architecturePeoplesoft PIA architecture
Peoplesoft PIA architecture
 
SOFTWARE COMPUTING
SOFTWARE COMPUTINGSOFTWARE COMPUTING
SOFTWARE COMPUTING
 
Lecture5 architecture styles.pdf
Lecture5 architecture styles.pdfLecture5 architecture styles.pdf
Lecture5 architecture styles.pdf
 
Linux Inter Process Communication
Linux Inter Process CommunicationLinux Inter Process Communication
Linux Inter Process Communication
 
Chapter 2B-Communication.ppt
Chapter 2B-Communication.pptChapter 2B-Communication.ppt
Chapter 2B-Communication.ppt
 
Server and Its Types - Presentation
Server and Its Types - PresentationServer and Its Types - Presentation
Server and Its Types - Presentation
 
Internetworking
InternetworkingInternetworking
Internetworking
 

More from sirajmohammed35

Wireless Local area networking power point
Wireless Local area networking  power pointWireless Local area networking  power point
Wireless Local area networking power pointsirajmohammed35
 
CSCI 5235_Present WiMax_[Zhen-Yu Fang].ppt
CSCI 5235_Present WiMax_[Zhen-Yu Fang].pptCSCI 5235_Present WiMax_[Zhen-Yu Fang].ppt
CSCI 5235_Present WiMax_[Zhen-Yu Fang].pptsirajmohammed35
 
ITN_instructorPPT_Chapter1.pptx
ITN_instructorPPT_Chapter1.pptxITN_instructorPPT_Chapter1.pptx
ITN_instructorPPT_Chapter1.pptxsirajmohammed35
 
Chapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.pptChapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.pptsirajmohammed35
 
Chapter 6-Consistency and Replication.ppt
Chapter 6-Consistency and Replication.pptChapter 6-Consistency and Replication.ppt
Chapter 6-Consistency and Replication.pptsirajmohammed35
 
Chapter 2A-Architectures.ppt
Chapter 2A-Architectures.pptChapter 2A-Architectures.ppt
Chapter 2A-Architectures.pptsirajmohammed35
 
Chapter 1-Introduction.ppt
Chapter 1-Introduction.pptChapter 1-Introduction.ppt
Chapter 1-Introduction.pptsirajmohammed35
 

More from sirajmohammed35 (8)

Wireless Local area networking power point
Wireless Local area networking  power pointWireless Local area networking  power point
Wireless Local area networking power point
 
CSCI 5235_Present WiMax_[Zhen-Yu Fang].ppt
CSCI 5235_Present WiMax_[Zhen-Yu Fang].pptCSCI 5235_Present WiMax_[Zhen-Yu Fang].ppt
CSCI 5235_Present WiMax_[Zhen-Yu Fang].ppt
 
ITN_instructorPPT_Chapter1.pptx
ITN_instructorPPT_Chapter1.pptxITN_instructorPPT_Chapter1.pptx
ITN_instructorPPT_Chapter1.pptx
 
Chapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.pptChapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.ppt
 
Chapter 6-Consistency and Replication.ppt
Chapter 6-Consistency and Replication.pptChapter 6-Consistency and Replication.ppt
Chapter 6-Consistency and Replication.ppt
 
Chapter 4-Naming.ppt
Chapter 4-Naming.pptChapter 4-Naming.ppt
Chapter 4-Naming.ppt
 
Chapter 2A-Architectures.ppt
Chapter 2A-Architectures.pptChapter 2A-Architectures.ppt
Chapter 2A-Architectures.ppt
 
Chapter 1-Introduction.ppt
Chapter 1-Introduction.pptChapter 1-Introduction.ppt
Chapter 1-Introduction.ppt
 

Recently uploaded

Harmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms PresentationHarmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms Presentationtahreemzahra82
 
Topic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxTopic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxJorenAcuavera1
 
ALL ABOUT MIXTURES IN GRADE 7 CLASS PPTX
ALL ABOUT MIXTURES IN GRADE 7 CLASS PPTXALL ABOUT MIXTURES IN GRADE 7 CLASS PPTX
ALL ABOUT MIXTURES IN GRADE 7 CLASS PPTXDole Philippines School
 
Environmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial BiosensorEnvironmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial Biosensorsonawaneprad
 
OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024innovationoecd
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationColumbia Weather Systems
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...lizamodels9
 
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...Universidade Federal de Sergipe - UFS
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologycaarthichand2003
 
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPirithiRaju
 
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxLIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxmalonesandreagweneth
 
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 GenuineCall Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuinethapagita
 
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxTHE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxNandakishor Bhaurao Deshmukh
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxpriyankatabhane
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)riyaescorts54
 
PROJECTILE MOTION-Horizontal and Vertical
PROJECTILE MOTION-Horizontal and VerticalPROJECTILE MOTION-Horizontal and Vertical
PROJECTILE MOTION-Horizontal and VerticalMAESTRELLAMesa2
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxEran Akiva Sinbar
 
Citronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayCitronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayupadhyaymani499
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPirithiRaju
 

Recently uploaded (20)

Harmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms PresentationHarmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms Presentation
 
Topic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxTopic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptx
 
ALL ABOUT MIXTURES IN GRADE 7 CLASS PPTX
ALL ABOUT MIXTURES IN GRADE 7 CLASS PPTXALL ABOUT MIXTURES IN GRADE 7 CLASS PPTX
ALL ABOUT MIXTURES IN GRADE 7 CLASS PPTX
 
Environmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial BiosensorEnvironmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial Biosensor
 
OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather Station
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
 
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technology
 
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
 
Let’s Say Someone Did Drop the Bomb. Then What?
Let’s Say Someone Did Drop the Bomb. Then What?Let’s Say Someone Did Drop the Bomb. Then What?
Let’s Say Someone Did Drop the Bomb. Then What?
 
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxLIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
 
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 GenuineCall Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
 
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxTHE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptx
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
 
PROJECTILE MOTION-Horizontal and Vertical
PROJECTILE MOTION-Horizontal and VerticalPROJECTILE MOTION-Horizontal and Vertical
PROJECTILE MOTION-Horizontal and Vertical
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptx
 
Citronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayCitronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyay
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
 

Chapter 3-Processes.ppt

  • 1. 1 Chapter 3 - Processes
  • 2. 2 Introduction  communication takes place between processes  a process is a program in execution  from OS perspective, management and scheduling of processes is important  other important issues arise in distributed systems  multithreading to enhance performance  how are clients and servers organized  process or code migration to achieve scalability and to dynamically configure clients and servers
  • 3. 3 3.1 Threads and their Implementation  threads can be used in both distributed and nondistributed systems  Threads in Nondistributed Systems  a process has an address space (containing program text and data) and a single thread of control, as well as other resources such as open files, child processes, accounting information, etc. Process 1 Process 2 Process 3 three processes each with one thread one process with three threads
  • 4. 4  each thread has its own program counter, registers, stack, and state; but all threads of a process share address space, global variables and other resources such as open files, etc.
  • 5. 5  Threads take turns in running  Threads allow multiple executions to take place in the same process environment, called multithreading  Thread Usage – Why do we need threads?  e.g., a word processor has different parts; parts for  interacting with the user  formatting the page as soon as changes are made  timed savings (for auto recovery)  spelling and grammar checking, etc. 1. Simplifying the programming model: since many activities are going on at once 2. They are easier to create and destroy than processes since they do not have any resources attached to them 3. Performance improves by overlapping activities if there is too much I/O; i.e., to avoid blocking when waiting for input or doing calculations, say in a spreadsheet 4. Real parallelism is possible in a multiprocessor system
  • 6. 6  having finer granularity in terms of multiple threads per process rather than processes provides better performance and makes it easier to build distributed applications  in nondistributed systems, threads can be used with shared data instead of processes to avoid context switching overhead in interprocess communication (IPC) context switching as the result of IPC process A to process B
  • 7. 7  Threads in Distributed Systems  Multithreaded Clients  consider a Web browser; fetching different parts of a page can be implemented as a separate thread, each opening its own TCP/IP connection to the server or to separate and replicated servers  each can display the results as it gets its part of the page  Multithreaded Servers  servers can be constructed in three ways 1.single-threaded process  it gets a request, examines it, carries it out to completion before getting the next request  the server is idle while waiting for disk read, i.e., system calls are blocking
  • 8. 8 2. threads  threads are more important for implementing servers  e.g., a file server  the dispatcher thread reads incoming requests for a file operation from clients and passes it to an idle worker thread  the worker thread performs a blocking disk read; in which case another thread may continue, say the dispatcher or another worker thread a multithreaded server organized in a dispatcher/worker model
  • 9. 9 3. finite-state machine  if threads are not available  it gets a request, examines it, tries to fulfill the request from cache, else sends a request to the file system; but instead of blocking it records the state of the current request and proceeds to the next request  Summary three ways to construct a server Model Characteristics Single-threaded process No parallelism, blocking system calls Threads Parallelism, blocking system calls (thread only) Finite-state machine Parallelism, nonblocking system calls
  • 10. 10  Two issues: user interfaces and client-side software for distribution transparency(reading assignment) 1. User Interfaces  to create a convenient environment for the interaction of a human user and a remote server; e.g. mobile phones with simple displays and a set of keys  GUIs are most commonly used  The X Window System (or simply X)  it has the X-kernel: the part of the OS that controls the terminal (monitor, keyboard, pointing device like a mouse)  contains all terminal-specific device drivers through the library called xlib 3.2 Anatomy of Clients
  • 11. 11 the basic organization of the X Window System
  • 12. 12  issues  how to organize servers?  where do clients contact a server?  whether and how a server can be interrupted  whether or not the server is stateless 1. how to organize servers?  iterative server  the server itself handles the request and returns the result  concurrent server  it passes a request to a separate process or thread and waits for the next incoming request; e.g., a multithreaded server 3.3 Servers: General Design Issues
  • 13. 13 2. where do clients contact a server?  using endpoints or ports at the machine where the server is running where each server listens to a specific endpoint  how do clients know the endpoint of a service?  globally assign endpoints for well-known services; e.g. FTP is on TCP port 21, HTTP is on TCP port 80  for services that do not require preassigned endpoints, it can be dynamically assigned by the local OS  how can the client know this endpoint? two approaches a. have a daemon running and listening to a well-known endpoint like in DCE; it keeps track of all endpoints of services on the collocated server  the client will first contact the daemon which provides it with the endpoint, and then the client contacts the specific server
  • 14. 14 Client-to-server binding using a daemon as in DCE
  • 15. B 15 3. whether and how a server can be interrupted  for instance, a user may want to interrupt a file transfer, may be it was the wrong file  let the client exit the client application; this will break the connection to the server; the server will tear down the connection assuming that the client had crashed or  let the client send out-of-bound data, data to be processed by the server before any other data from the client; the server may listen on a separate control endpoint; or send it on the same connection as urgent data as is in TCP 4. whether or not the server is stateless  a stateless server does not keep information on the state of its clients; for instance a Web server  a stateful server maintains information about its clients; for instance a file server that allows a client to keep a local copy of a file and can make update operations
  • 16. 16  so far, communication was concerned on passing data  we may pass programs, even while running and in heterogeneous systems  code migration also involves moving data as well: when a program migrates while running, its status, pending signals, and other environment variables such as the stack and the program counter also have to be moved 3.4 Code Migration 1. Reasons for Migrating Code  to improve performance; move processes from heavily- loaded to lightly-loaded machines (load balancing)  to reduce communication: move a client application that performs many database operations to a server if the database resides on the server; then send only results to the client  to exploit parallelism (for nonparallel programs): e.g., copies of a mobile program moving from site to site searching the Web
  • 17. 17 2. Models for Code Migration  a process consists of three segments: code segment (set of instructions), resource segment (references to external resources such as files, printers, ...), and execution segment (to store the current execution state of a process such as private data, the stack, the program counter)  Weak Mobility  transfer only the code segment and may be some initialization data; in this case a program always starts from its initial stage, e.g. Java Applets  execution can be by the target process (in its own address space like in Java Applets) or by a separate process
  • 18. 18  Strong Mobility  transfer code and execution segments; helps to migrate a process in execution  can also be supported by remote cloning; having an exact copy of the original process and running on a different machine; executed in parallel to the original process; UNIX does this by forking a child process  migration can be  sender-initiated: the machine where the code resides or is currently running; e.g., uploading programs to a server; may need authentication or that the client is a registered one  receiver-initiated: by the target machine; e.g., Java Applets; easier to implement
  • 19. 19  Summary of models of code migration alternatives for code migration
  • 20. 20 3. Migration and Local Resources  how to migrate the resource segment  not always possible to move a resource; e.g., a reference to TCP port held by a process to communicate with other processes  Types of Process-to-Resource Bindings  Binding by identifier (the strongest): a resource is referred by its identifier; e.g., a URL to refer to a Web page or an FTP server referred by its Internet address  Binding by value (weaker): when only the value of a resource is needed; in this case another resource can provide the same value; e.g., standard libraries of programming languages such as C or Java which are normally locally available, but their location in the file system may vary from site to site  Binding by type (weakest): a process needs a resource of a specific type; reference to local devices, such as monitors, printers, ...
  • 21. 21  how can a reference be changed? depends whether the resource can be moved along with the code, i.e., resource-to- machine binding  Types of Resource-to-Machine Bindings  Unattached Resources: can be easily moved with the migrating program (such as data files associated with the program)  Fastened Resources: such as local databases and complete Web sites; moving or copying may be possible, but very costly  Fixed Resources: intimately bound to a specific machine or environment such as local devices and cannot be moved we have nine combinations to consider
  • 22. 22 actions to be taken with respect to the references to local resources when migrating code to another machine Unattached Fastened Fixed By identifier By value By type MV (or GR) CP (or MV, GR) RB (or GR, CP) GR (or MV) GR (or CP) RB (or GR, CP) GR GR RB (or GR) Resource-to machine binding Process-to- resource binding  GR: Establish a global system wide reference  MV: Move the resource  CP: Copy the value of the resource  RB: Rebind process to a locally available resource  Exercise: for each of the nine combinations, give example resources

Editor's Notes

  1. 1