SlideShare a Scribd company logo
1
Chapter 3
Processes
2
Revision on Processes and Threads
To understand the role of threads in distributed systems, it is important to understand
what a process is, and how processes and threads relate.
To execute a program, an operating system creates a number of virtual processors, each
one for running a different program.
To keep track of these virtual processors, the operating system has a process table
containing
• entries to store CPU register values,
• memory maps,
• open files,
• accounting information.
• privileges, e.t.c …
3
Revision on Processes and Threads
Processes
Process is a program in execution
It is instance of a computer program that is being executed on one of operating
system’s virtual processors.
The process takes more time to terminate, and it is isolated means it does not share
the memory with any other process.
4
Revision on Processes and Threads
Thread
Threads are often called “lightweight processes” because they share some features
of processes but are smaller and faster.
Each thread is always part of one specific process.
A thread has three states:
 Running
 Ready and
 Blocked.
5
Processes Vs Threads
Processes
Processes are unit of allocation
Each process has one or more
Threads.
Inter process communication is
expensive because it needs context
switching
Secure &one process can’t corrupt
another process.
Threads
Threads are unit of execution
Each Thread belongs to one process
Inter thread communication is cheap.
Because it can use process memory
and many not need to context switch.
Threads are not secure because a
thread can write the memory used by
another thread.
6
7
Threads in distributed system.
An important property of threads is that they can provide a convenient means of
allowing blocking system calls without blocking the entire process in which the
thread is running.
This property makes threads particularly attractive to use in distributed systems as
it makes it much easier to express communication in the form of maintaining
multiple logical connections at the same time.
To understand this in a better way le us look at multithreaded clients and servers,
respectively.
8
Multithreaded Clients
To establish a high degree of distribution transparency, distributed systems that operate in wide-
area networks may need to conceal long inter process message propagation times.
The usual way to hide communication latencies is to initiate communication and immediately
proceed with something else.
A typical example where this happens is in Web browsers.
 In many cases, a Web document consists of an HTML file containing plain text along with a
collection of images, icons, etc. To fetch each element of a Web document, the browser has to set
up a TCPIIP connection, read the incoming data, and pass it to a display component.
A Web browser often starts with fetching the HTML page and subsequently displays it. To hide
communication latencies as much as possible, some browsers start displaying data while it is still
coming in. While the text is made available to the user, including the facilities for scrolling and
such, the browser continues with fetching other files that make up the page, such as the images.
9
Multithreaded Servers
The main use of multithreading in distributed systems is found at the
server side.
 multithreading not only simplifies server code considerably, but also
makes it much easier to develop servers that exploit parallelism to
attain high performance, even on uniprocessor systems.
To understand the benefits of threads for writing server code,
consider the organization of a file server that occasionally has to block
waiting for the disk.
The file server normally waits for an incoming request for a file
operation, subsequently carries out the request, and then sends back
the reply. One possible, and particularly popular organization is shown
in the figure below.
10
11
Clients
A distributed system is a network of interconnected computers that work together
to provide seamless services. At the core of this architecture are clients and
servers—two fundamental components that interact to ensure smooth operation.
 Clients refer to the devices or applications that request services or resources from
a centralized server.
Example :
Imagine using a food delivery app like Uber Eats. The app on your phone acts as a
client, sending a request when you order food. The request goes to a server, which
processes it by checking restaurant availability, calculating delivery time, and
updating your order status.
12
Clients
User Interfaces in Distributed Systems
A User Interface (UI) is the bridge between humans and machines, enabling users
to interact with a system effortlessly.
In distributed systems, UIs allow people to access remote services, whether
through
 graphical interfaces,
command-line tools, or
 web-based dashboards
13
Clients
Example :
1. Consider a banking app. The app presents a Graphical user interface (GUI) with
buttons, menus, and icons, making it easy for users to transfer money or check
balances.
2. There’s also the Command-line interface (CLI), used by advanced users and
system administrators. For example, when a developer accesses a cloud-based
server using an SSH terminal, they interact through text-based commands rather
than visual buttons.
3. A web-based interface is another common UI in distributed systems. Platforms
like Google Docs allow multiple users to edit the same document in real-time,
thanks to a responsive UI that continuously syncs changes with remote servers.
14
Clients
Networked User Interfaces
• A major task of client machines is to provide the means for users to interact with remote
servers.
• There are roughly two ways in which this interaction can be supported.
1.For each remote service the client machine will have a separate counterpart that can
contact the service over the network.
2. Provide direct access to remote services by only offering a convenient
user interface.
15
1. For each remote service the client machine will have a separate counterpart that can
contact the service over the network.
Example
The email client connecting to the email server to send, receive, and manage emails via
Gmail App.
16
2. Provide direct access to remote services by only offering a convenient
user interface.
Effectively, this means that the client machine is used only as a terminal with
no need for local storage, leading to an application neutral solution below.
Example
The web browser acts purely as a terminal, allowing users to interact with
Google Docs without needing any local installation of office software. Users
can access their documents from any device with internet access, and all
changes are saved remotely.
17
Client-Side Software for Distribution Transparency
Distributed systems operate across multiple locations, but to the user, everything appears
unified. This illusion is created by distribution transparency, which hides the complexities
of the system from users and applications.
Types of transparency
1. Access transparency: is where users don’t need to know whether they are accessing
local or remote resources. For example, when you open a file in Google Drive, you
don’t worry about whether it’s stored on a server in the US or Europe. It just works.
2. Location transparency: ensures that users don’t need to know where a service is
physically located. When you search something on Google, your request might be
handled by a server in India, Germany, or Canada, but you don’t need to care—it just
delivers results instantly.
18
3.Replication transparency: is what ensures that even if multiple copies of a resource exist
across different servers, the system presents them as a single entity. This is essential for cloud
services like Dropbox, where files are backed up on multiple servers, yet users only see one
version.
4.Failure transparency: is what keeps systems running smoothly despite failures. Think of a
video streaming service like Netflix. If one server crashes, another immediately takes over,
ensuring that your movie continues without interruption. This is possible because of load
balancing, which distributes requests across multiple servers.
To achieve all these transparencies, client-side software employs techniques like
middleware, which acts as a bridge between different parts of a distributed system,
caching, which stores frequently used data to reduce response times, and load balancing,
which distributes workloads evenly to avoid overloading any single server.
Analogical Example :
a restaurant kitchen. The customers don’t see what’s happening inside. They just place their orders,
and food arrives at their table. The kitchen could have multiple chefs working, switching roles if
someone is unavailable, but to the customer, it looks like a single efficient operation. , . In the case
of distributed system it is Software for Distribution Transparency that enables this
abstraction.
19
Servers
Servers are powerful computers or systems that provide resources, services, or data to other computers,
known as clients, over a network.
General Design
A server is a process implementing a specific service on behalf of a collection of clients.
In essence, each server is organized in the same way: it waits for an incoming request from a client and
subsequently ensures that the request is taken care of, after which it waits for the next incoming request.
There are several ways to organize servers
1. Iterative server, the server itself handles the request and, if necessary, returns a response to the requesting
client.
2. A concurrent server does not handle the request itself, but passes it to a separate thread or another
process, after which it immediately waits for the next incoming request.
A multithreaded server is an example of a concurrent server.
The thread or process that handles the request is responsible for returning a response to the requesting client.
20
Servers
A server is the backbone of a distributed system. It processes requests, manages resources, and
ensures that clients receive the services they need.
Servers come in different types, each with a specific role.
Web servers : host websites and deliver web pages when users enter URLs. When you visit
Facebook, your browser sends a request to a web server, which responds with the necessary
content.
Database servers: which store and retrieve data. For example :every time you search for a
product on Amazon, a database server fetches relevant results from a massive collection of
stored data.
Application servers : handle complex business logic. In an online shopping system, an
application server might calculate discounts, process payments, and update stock levels.
A good analogy for a server is a waiter in a restaurant. When a customer orders food, the waiter
takes the request to the kitchen, gets the food prepared, and serves it back to the customer. Similarly,
a server takes client requests, processes them, and returns responses.
21
Where clients contact a server?
In all cases, clients send requests to an end point, also called a port, at the machine where the server is running.
Each server listens to a specific end point.
How do clients know the end point of a service?
?
22
1. Globally assign end points for well-known services.
These end points have been assigned by the Internet Assigned Numbers Authority (IANA),
Example
 servers that handle Internet FTP requests always listen to TCP port 21.
 HTTP server for the World Wide Web will always listen to TCP port 80.
2.Service Discovery
This approach allows applications to dynamically find and connect to services in a network, rather than relying
on hard-coded endpoints.
Example
DNS SRV Records
• Scenario: A Microservices-Based E-Commerce Application
Imagine an e-commerce application consisting of various microservices, including a user service, product
service, and payment service. Each of these services runs on different servers or containers in a cloud
environment. To facilitate communication among these services, DNS SRV records can be utilized for service
discovery.
23
Client-to-server bindings using daemons and super servers
1. Client-to-Server Binding Using Daemons
In this model, each service is managed by its own daemon process. A daemon
is a background service that listens for client requests on a specific port.
24
Client-to-server bindings using daemons and super servers
2. Client-to-Server Binding Using Super servers
A super server is a single daemon that listens on a well-known port and manages multiple
services. It acts as a gateway for clients to communicate with various services.
25
Daemon Binding Vs Super server Binding
Feature Daemon Binding Super server Binding
Architecture Each service has its own daemon.
One superserver manages multiple
services.
Connection Method Direct connection to the daemon. Connect to the superserver which
delegates.
Resource Usage
More resource-intensive (multiple
daemons).
More efficient (single process for
many services).
Failure Isolation Failures are isolated to individual
daemons.
Failure of the superserver affects all
services.
Client Configuration Clients need to know specific ports.
Clients connect to a single entry
point.
26
Servers and State
One of the biggest decisions in designing a distributed system is whether a server should be
stateless or stateful.
In the context of stateless and stateful servers, state refers to any data or information about
a client's session that a server retains between multiple requests. It helps the server
remember past interactions, making responses more context-aware.
stateful servers
a stateful server is a server that keeps track of previous client interactions. And this
property is necessary for services that require continuity, like online banking or shopping
carts. When you add an item to your cart on Amazon and come back later, the server
remembers what you selected because it maintains session data.
While stateful servers provide a personalized experience, they require more memory and
resources to store session data.
27
Servers and State
Stateless server
A stateless server treats every client request as independent, meaning it does not store any
previous interaction data. This makes it highly scalable and efficient because there’s no
need to maintain user-specific information. Web servers, like those that serve static
websites, are often stateless. Every time you visit a page, the server processes your request
from scratch, without remembering past interactions.
Stateless servers are faster and more scalable but lack continuity.
28
Server
Clusters
A server cluster is nothing else but a collection of machines connected through a network, where each
machine runs one or more servers.
The server clusters that we consider here, are the ones in which the machines are connected through a local-
area network, often offering high bandwidth and low latency.
In most cases, a server cluster is logically organized into three tiers, as shown in Fig below
29
1. Presentation(first) Tier
This is the top layer where the user interacts with the application. It handles user interface and user experience.
The first tier consists of a (logical) switch through which client requests are routed.
Example:
A web application interface that users access through a browser.
2. Application(second) Tier
Also known as the middle tier, this layer contains the business logic of the application. It processes user
requests and executes the necessary operations.
Example
An application server that handles business logic and interacts with various services.
30
3. Data (third) Tier
This is the bottom layer responsible for data storage and management. It includes databases
and data-related services.
Example:
A relational database management system (RDBMS) like MySQL or PostgreSQL.
31
END!!!
Ad

More Related Content

Similar to Distrinuted system chapter three on task division and task scheduling (20)

distributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptxdistributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptx
lencho3d
 
Solutions for Exercises: Distributed Systems 5th Edition by Coulouris & Dolli...
Solutions for Exercises: Distributed Systems 5th Edition by Coulouris & Dolli...Solutions for Exercises: Distributed Systems 5th Edition by Coulouris & Dolli...
Solutions for Exercises: Distributed Systems 5th Edition by Coulouris & Dolli...
industriale82
 
SOFTWARE COMPUTING
SOFTWARE COMPUTINGSOFTWARE COMPUTING
SOFTWARE COMPUTING
DrThenmozhiKarunanit
 
Clientserver
ClientserverClientserver
Clientserver
Madhumithah Ilango
 
Chapter 1 introduction
Chapter 1 introductionChapter 1 introduction
Chapter 1 introduction
Tamrat Amare
 
09-01-services-slides.pdf for educations
09-01-services-slides.pdf for educations09-01-services-slides.pdf for educations
09-01-services-slides.pdf for educations
katariraju71
 
CSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating SystemCSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating System
ghayour abbas
 
Computing Environments.pptx
Computing Environments.pptxComputing Environments.pptx
Computing Environments.pptx
MSivani
 
Introduction-to-Distributed-Systems Introduction-to-Distributed-Systems.pdf
Introduction-to-Distributed-Systems Introduction-to-Distributed-Systems.pdfIntroduction-to-Distributed-Systems Introduction-to-Distributed-Systems.pdf
Introduction-to-Distributed-Systems Introduction-to-Distributed-Systems.pdf
bilqesahmed60
 
H017113842
H017113842H017113842
H017113842
IOSR Journals
 
An in-building multi-server cloud system based on shortest Path algorithm dep...
An in-building multi-server cloud system based on shortest Path algorithm dep...An in-building multi-server cloud system based on shortest Path algorithm dep...
An in-building multi-server cloud system based on shortest Path algorithm dep...
IOSR Journals
 
An Introduction to Cloud Computing: Benefits and Challenges
An Introduction to Cloud Computing: Benefits and ChallengesAn Introduction to Cloud Computing: Benefits and Challenges
An Introduction to Cloud Computing: Benefits and Challenges
Sisodetrupti
 
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
Attaullah Hazrat
 
Operating system
Operating systemOperating system
Operating system
Neha Saxena
 
Distributed Computing Report
Distributed Computing ReportDistributed Computing Report
Distributed Computing Report
IIT Kharagpur
 
Chapter One.ppt
Chapter One.pptChapter One.ppt
Chapter One.ppt
abdigeremew
 
Building Intranet Assignment 2009 03 14 roshan basnet (1)
Building Intranet Assignment 2009 03 14 roshan basnet (1)Building Intranet Assignment 2009 03 14 roshan basnet (1)
Building Intranet Assignment 2009 03 14 roshan basnet (1)
rosu555
 
Chapter 3-Processes2.pptx
Chapter 3-Processes2.pptxChapter 3-Processes2.pptx
Chapter 3-Processes2.pptx
MeymunaMohammed1
 
Distributed Operating System.pptx
Distributed Operating System.pptxDistributed Operating System.pptx
Distributed Operating System.pptx
harpreetkaur1129
 
Web-Server & It's Architecture.pptx
Web-Server & It's Architecture.pptxWeb-Server & It's Architecture.pptx
Web-Server & It's Architecture.pptx
AlokKumar250045
 
distributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptxdistributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptx
lencho3d
 
Solutions for Exercises: Distributed Systems 5th Edition by Coulouris & Dolli...
Solutions for Exercises: Distributed Systems 5th Edition by Coulouris & Dolli...Solutions for Exercises: Distributed Systems 5th Edition by Coulouris & Dolli...
Solutions for Exercises: Distributed Systems 5th Edition by Coulouris & Dolli...
industriale82
 
Chapter 1 introduction
Chapter 1 introductionChapter 1 introduction
Chapter 1 introduction
Tamrat Amare
 
09-01-services-slides.pdf for educations
09-01-services-slides.pdf for educations09-01-services-slides.pdf for educations
09-01-services-slides.pdf for educations
katariraju71
 
CSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating SystemCSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating System
ghayour abbas
 
Computing Environments.pptx
Computing Environments.pptxComputing Environments.pptx
Computing Environments.pptx
MSivani
 
Introduction-to-Distributed-Systems Introduction-to-Distributed-Systems.pdf
Introduction-to-Distributed-Systems Introduction-to-Distributed-Systems.pdfIntroduction-to-Distributed-Systems Introduction-to-Distributed-Systems.pdf
Introduction-to-Distributed-Systems Introduction-to-Distributed-Systems.pdf
bilqesahmed60
 
An in-building multi-server cloud system based on shortest Path algorithm dep...
An in-building multi-server cloud system based on shortest Path algorithm dep...An in-building multi-server cloud system based on shortest Path algorithm dep...
An in-building multi-server cloud system based on shortest Path algorithm dep...
IOSR Journals
 
An Introduction to Cloud Computing: Benefits and Challenges
An Introduction to Cloud Computing: Benefits and ChallengesAn Introduction to Cloud Computing: Benefits and Challenges
An Introduction to Cloud Computing: Benefits and Challenges
Sisodetrupti
 
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
Attaullah Hazrat
 
Operating system
Operating systemOperating system
Operating system
Neha Saxena
 
Distributed Computing Report
Distributed Computing ReportDistributed Computing Report
Distributed Computing Report
IIT Kharagpur
 
Building Intranet Assignment 2009 03 14 roshan basnet (1)
Building Intranet Assignment 2009 03 14 roshan basnet (1)Building Intranet Assignment 2009 03 14 roshan basnet (1)
Building Intranet Assignment 2009 03 14 roshan basnet (1)
rosu555
 
Distributed Operating System.pptx
Distributed Operating System.pptxDistributed Operating System.pptx
Distributed Operating System.pptx
harpreetkaur1129
 
Web-Server & It's Architecture.pptx
Web-Server & It's Architecture.pptxWeb-Server & It's Architecture.pptx
Web-Server & It's Architecture.pptx
AlokKumar250045
 

Recently uploaded (20)

HershAggregator (2).pdf musicretaildistribution
HershAggregator (2).pdf musicretaildistributionHershAggregator (2).pdf musicretaildistribution
HershAggregator (2).pdf musicretaildistribution
hershtara1
 
report (maam dona subject).pptxhsgwiswhs
report (maam dona subject).pptxhsgwiswhsreport (maam dona subject).pptxhsgwiswhs
report (maam dona subject).pptxhsgwiswhs
AngelPinedaTaguinod
 
How to Set Up Process Mining in a Decentralized Organization?
How to Set Up Process Mining in a Decentralized Organization?How to Set Up Process Mining in a Decentralized Organization?
How to Set Up Process Mining in a Decentralized Organization?
Process mining Evangelist
 
Dynamics 365 Business Rules Dynamics Dynamics
Dynamics 365 Business Rules Dynamics DynamicsDynamics 365 Business Rules Dynamics Dynamics
Dynamics 365 Business Rules Dynamics Dynamics
heyoubro69
 
hersh's midterm project.pdf music retail and distribution
hersh's midterm project.pdf music retail and distributionhersh's midterm project.pdf music retail and distribution
hersh's midterm project.pdf music retail and distribution
hershtara1
 
AI ------------------------------ W1L2.pptx
AI ------------------------------ W1L2.pptxAI ------------------------------ W1L2.pptx
AI ------------------------------ W1L2.pptx
AyeshaJalil6
 
文凭证书美国SDSU文凭圣地亚哥州立大学学生证学历认证查询
文凭证书美国SDSU文凭圣地亚哥州立大学学生证学历认证查询文凭证书美国SDSU文凭圣地亚哥州立大学学生证学历认证查询
文凭证书美国SDSU文凭圣地亚哥州立大学学生证学历认证查询
Taqyea
 
Analysis of Billboards hot 100 toop five hit makers on the chart.docx
Analysis of Billboards hot 100 toop five hit makers on the chart.docxAnalysis of Billboards hot 100 toop five hit makers on the chart.docx
Analysis of Billboards hot 100 toop five hit makers on the chart.docx
hershtara1
 
Process Mining at Deutsche Bank - Journey
Process Mining at Deutsche Bank - JourneyProcess Mining at Deutsche Bank - Journey
Process Mining at Deutsche Bank - Journey
Process mining Evangelist
 
Process Mining as Enabler for Digital Transformations
Process Mining as Enabler for Digital TransformationsProcess Mining as Enabler for Digital Transformations
Process Mining as Enabler for Digital Transformations
Process mining Evangelist
 
lecture_13 tree in mmmmmmmm mmmmmfftro.pptx
lecture_13 tree in mmmmmmmm     mmmmmfftro.pptxlecture_13 tree in mmmmmmmm     mmmmmfftro.pptx
lecture_13 tree in mmmmmmmm mmmmmfftro.pptx
sarajafffri058
 
50_questions_full.pptxdddddddddddddddddd
50_questions_full.pptxdddddddddddddddddd50_questions_full.pptxdddddddddddddddddd
50_questions_full.pptxdddddddddddddddddd
emir73065
 
录取通知书加拿大TMU毕业证多伦多都会大学电子版毕业证成绩单
录取通知书加拿大TMU毕业证多伦多都会大学电子版毕业证成绩单录取通知书加拿大TMU毕业证多伦多都会大学电子版毕业证成绩单
录取通知书加拿大TMU毕业证多伦多都会大学电子版毕业证成绩单
Taqyea
 
Oral Malodor.pptx jsjshdhushehsidjjeiejdhfj
Oral Malodor.pptx jsjshdhushehsidjjeiejdhfjOral Malodor.pptx jsjshdhushehsidjjeiejdhfj
Oral Malodor.pptx jsjshdhushehsidjjeiejdhfj
maitripatel5301
 
problem solving.presentation slideshow bsc nursing
problem solving.presentation slideshow bsc nursingproblem solving.presentation slideshow bsc nursing
problem solving.presentation slideshow bsc nursing
vishnudathas123
 
L1_Slides_Foundational Concepts_508.pptx
L1_Slides_Foundational Concepts_508.pptxL1_Slides_Foundational Concepts_508.pptx
L1_Slides_Foundational Concepts_508.pptx
38NoopurPatel
 
CS-404 COA COURSE FILE JAN JUN 2025.docx
CS-404 COA COURSE FILE JAN JUN 2025.docxCS-404 COA COURSE FILE JAN JUN 2025.docx
CS-404 COA COURSE FILE JAN JUN 2025.docx
nidarizvitit
 
AWS-Certified-ML-Engineer-Associate-Slides.pdf
AWS-Certified-ML-Engineer-Associate-Slides.pdfAWS-Certified-ML-Engineer-Associate-Slides.pdf
AWS-Certified-ML-Engineer-Associate-Slides.pdf
philsparkshome
 
Controlling Financial Processes at a Municipality
Controlling Financial Processes at a MunicipalityControlling Financial Processes at a Municipality
Controlling Financial Processes at a Municipality
Process mining Evangelist
 
Sets theories and applications that can used to imporve knowledge
Sets theories and applications that can used to imporve knowledgeSets theories and applications that can used to imporve knowledge
Sets theories and applications that can used to imporve knowledge
saumyasl2020
 
HershAggregator (2).pdf musicretaildistribution
HershAggregator (2).pdf musicretaildistributionHershAggregator (2).pdf musicretaildistribution
HershAggregator (2).pdf musicretaildistribution
hershtara1
 
report (maam dona subject).pptxhsgwiswhs
report (maam dona subject).pptxhsgwiswhsreport (maam dona subject).pptxhsgwiswhs
report (maam dona subject).pptxhsgwiswhs
AngelPinedaTaguinod
 
How to Set Up Process Mining in a Decentralized Organization?
How to Set Up Process Mining in a Decentralized Organization?How to Set Up Process Mining in a Decentralized Organization?
How to Set Up Process Mining in a Decentralized Organization?
Process mining Evangelist
 
Dynamics 365 Business Rules Dynamics Dynamics
Dynamics 365 Business Rules Dynamics DynamicsDynamics 365 Business Rules Dynamics Dynamics
Dynamics 365 Business Rules Dynamics Dynamics
heyoubro69
 
hersh's midterm project.pdf music retail and distribution
hersh's midterm project.pdf music retail and distributionhersh's midterm project.pdf music retail and distribution
hersh's midterm project.pdf music retail and distribution
hershtara1
 
AI ------------------------------ W1L2.pptx
AI ------------------------------ W1L2.pptxAI ------------------------------ W1L2.pptx
AI ------------------------------ W1L2.pptx
AyeshaJalil6
 
文凭证书美国SDSU文凭圣地亚哥州立大学学生证学历认证查询
文凭证书美国SDSU文凭圣地亚哥州立大学学生证学历认证查询文凭证书美国SDSU文凭圣地亚哥州立大学学生证学历认证查询
文凭证书美国SDSU文凭圣地亚哥州立大学学生证学历认证查询
Taqyea
 
Analysis of Billboards hot 100 toop five hit makers on the chart.docx
Analysis of Billboards hot 100 toop five hit makers on the chart.docxAnalysis of Billboards hot 100 toop five hit makers on the chart.docx
Analysis of Billboards hot 100 toop five hit makers on the chart.docx
hershtara1
 
Process Mining as Enabler for Digital Transformations
Process Mining as Enabler for Digital TransformationsProcess Mining as Enabler for Digital Transformations
Process Mining as Enabler for Digital Transformations
Process mining Evangelist
 
lecture_13 tree in mmmmmmmm mmmmmfftro.pptx
lecture_13 tree in mmmmmmmm     mmmmmfftro.pptxlecture_13 tree in mmmmmmmm     mmmmmfftro.pptx
lecture_13 tree in mmmmmmmm mmmmmfftro.pptx
sarajafffri058
 
50_questions_full.pptxdddddddddddddddddd
50_questions_full.pptxdddddddddddddddddd50_questions_full.pptxdddddddddddddddddd
50_questions_full.pptxdddddddddddddddddd
emir73065
 
录取通知书加拿大TMU毕业证多伦多都会大学电子版毕业证成绩单
录取通知书加拿大TMU毕业证多伦多都会大学电子版毕业证成绩单录取通知书加拿大TMU毕业证多伦多都会大学电子版毕业证成绩单
录取通知书加拿大TMU毕业证多伦多都会大学电子版毕业证成绩单
Taqyea
 
Oral Malodor.pptx jsjshdhushehsidjjeiejdhfj
Oral Malodor.pptx jsjshdhushehsidjjeiejdhfjOral Malodor.pptx jsjshdhushehsidjjeiejdhfj
Oral Malodor.pptx jsjshdhushehsidjjeiejdhfj
maitripatel5301
 
problem solving.presentation slideshow bsc nursing
problem solving.presentation slideshow bsc nursingproblem solving.presentation slideshow bsc nursing
problem solving.presentation slideshow bsc nursing
vishnudathas123
 
L1_Slides_Foundational Concepts_508.pptx
L1_Slides_Foundational Concepts_508.pptxL1_Slides_Foundational Concepts_508.pptx
L1_Slides_Foundational Concepts_508.pptx
38NoopurPatel
 
CS-404 COA COURSE FILE JAN JUN 2025.docx
CS-404 COA COURSE FILE JAN JUN 2025.docxCS-404 COA COURSE FILE JAN JUN 2025.docx
CS-404 COA COURSE FILE JAN JUN 2025.docx
nidarizvitit
 
AWS-Certified-ML-Engineer-Associate-Slides.pdf
AWS-Certified-ML-Engineer-Associate-Slides.pdfAWS-Certified-ML-Engineer-Associate-Slides.pdf
AWS-Certified-ML-Engineer-Associate-Slides.pdf
philsparkshome
 
Controlling Financial Processes at a Municipality
Controlling Financial Processes at a MunicipalityControlling Financial Processes at a Municipality
Controlling Financial Processes at a Municipality
Process mining Evangelist
 
Sets theories and applications that can used to imporve knowledge
Sets theories and applications that can used to imporve knowledgeSets theories and applications that can used to imporve knowledge
Sets theories and applications that can used to imporve knowledge
saumyasl2020
 
Ad

Distrinuted system chapter three on task division and task scheduling

  • 2. 2 Revision on Processes and Threads To understand the role of threads in distributed systems, it is important to understand what a process is, and how processes and threads relate. To execute a program, an operating system creates a number of virtual processors, each one for running a different program. To keep track of these virtual processors, the operating system has a process table containing • entries to store CPU register values, • memory maps, • open files, • accounting information. • privileges, e.t.c …
  • 3. 3 Revision on Processes and Threads Processes Process is a program in execution It is instance of a computer program that is being executed on one of operating system’s virtual processors. The process takes more time to terminate, and it is isolated means it does not share the memory with any other process.
  • 4. 4 Revision on Processes and Threads Thread Threads are often called “lightweight processes” because they share some features of processes but are smaller and faster. Each thread is always part of one specific process. A thread has three states:  Running  Ready and  Blocked.
  • 5. 5 Processes Vs Threads Processes Processes are unit of allocation Each process has one or more Threads. Inter process communication is expensive because it needs context switching Secure &one process can’t corrupt another process. Threads Threads are unit of execution Each Thread belongs to one process Inter thread communication is cheap. Because it can use process memory and many not need to context switch. Threads are not secure because a thread can write the memory used by another thread.
  • 6. 6
  • 7. 7 Threads in distributed system. An important property of threads is that they can provide a convenient means of allowing blocking system calls without blocking the entire process in which the thread is running. This property makes threads particularly attractive to use in distributed systems as it makes it much easier to express communication in the form of maintaining multiple logical connections at the same time. To understand this in a better way le us look at multithreaded clients and servers, respectively.
  • 8. 8 Multithreaded Clients To establish a high degree of distribution transparency, distributed systems that operate in wide- area networks may need to conceal long inter process message propagation times. The usual way to hide communication latencies is to initiate communication and immediately proceed with something else. A typical example where this happens is in Web browsers.  In many cases, a Web document consists of an HTML file containing plain text along with a collection of images, icons, etc. To fetch each element of a Web document, the browser has to set up a TCPIIP connection, read the incoming data, and pass it to a display component. A Web browser often starts with fetching the HTML page and subsequently displays it. To hide communication latencies as much as possible, some browsers start displaying data while it is still coming in. While the text is made available to the user, including the facilities for scrolling and such, the browser continues with fetching other files that make up the page, such as the images.
  • 9. 9 Multithreaded Servers The main use of multithreading in distributed systems is found at the server side.  multithreading not only simplifies server code considerably, but also makes it much easier to develop servers that exploit parallelism to attain high performance, even on uniprocessor systems. To understand the benefits of threads for writing server code, consider the organization of a file server that occasionally has to block waiting for the disk. The file server normally waits for an incoming request for a file operation, subsequently carries out the request, and then sends back the reply. One possible, and particularly popular organization is shown in the figure below.
  • 10. 10
  • 11. 11 Clients A distributed system is a network of interconnected computers that work together to provide seamless services. At the core of this architecture are clients and servers—two fundamental components that interact to ensure smooth operation.  Clients refer to the devices or applications that request services or resources from a centralized server. Example : Imagine using a food delivery app like Uber Eats. The app on your phone acts as a client, sending a request when you order food. The request goes to a server, which processes it by checking restaurant availability, calculating delivery time, and updating your order status.
  • 12. 12 Clients User Interfaces in Distributed Systems A User Interface (UI) is the bridge between humans and machines, enabling users to interact with a system effortlessly. In distributed systems, UIs allow people to access remote services, whether through  graphical interfaces, command-line tools, or  web-based dashboards
  • 13. 13 Clients Example : 1. Consider a banking app. The app presents a Graphical user interface (GUI) with buttons, menus, and icons, making it easy for users to transfer money or check balances. 2. There’s also the Command-line interface (CLI), used by advanced users and system administrators. For example, when a developer accesses a cloud-based server using an SSH terminal, they interact through text-based commands rather than visual buttons. 3. A web-based interface is another common UI in distributed systems. Platforms like Google Docs allow multiple users to edit the same document in real-time, thanks to a responsive UI that continuously syncs changes with remote servers.
  • 14. 14 Clients Networked User Interfaces • A major task of client machines is to provide the means for users to interact with remote servers. • There are roughly two ways in which this interaction can be supported. 1.For each remote service the client machine will have a separate counterpart that can contact the service over the network. 2. Provide direct access to remote services by only offering a convenient user interface.
  • 15. 15 1. For each remote service the client machine will have a separate counterpart that can contact the service over the network. Example The email client connecting to the email server to send, receive, and manage emails via Gmail App.
  • 16. 16 2. Provide direct access to remote services by only offering a convenient user interface. Effectively, this means that the client machine is used only as a terminal with no need for local storage, leading to an application neutral solution below. Example The web browser acts purely as a terminal, allowing users to interact with Google Docs without needing any local installation of office software. Users can access their documents from any device with internet access, and all changes are saved remotely.
  • 17. 17 Client-Side Software for Distribution Transparency Distributed systems operate across multiple locations, but to the user, everything appears unified. This illusion is created by distribution transparency, which hides the complexities of the system from users and applications. Types of transparency 1. Access transparency: is where users don’t need to know whether they are accessing local or remote resources. For example, when you open a file in Google Drive, you don’t worry about whether it’s stored on a server in the US or Europe. It just works. 2. Location transparency: ensures that users don’t need to know where a service is physically located. When you search something on Google, your request might be handled by a server in India, Germany, or Canada, but you don’t need to care—it just delivers results instantly.
  • 18. 18 3.Replication transparency: is what ensures that even if multiple copies of a resource exist across different servers, the system presents them as a single entity. This is essential for cloud services like Dropbox, where files are backed up on multiple servers, yet users only see one version. 4.Failure transparency: is what keeps systems running smoothly despite failures. Think of a video streaming service like Netflix. If one server crashes, another immediately takes over, ensuring that your movie continues without interruption. This is possible because of load balancing, which distributes requests across multiple servers. To achieve all these transparencies, client-side software employs techniques like middleware, which acts as a bridge between different parts of a distributed system, caching, which stores frequently used data to reduce response times, and load balancing, which distributes workloads evenly to avoid overloading any single server. Analogical Example : a restaurant kitchen. The customers don’t see what’s happening inside. They just place their orders, and food arrives at their table. The kitchen could have multiple chefs working, switching roles if someone is unavailable, but to the customer, it looks like a single efficient operation. , . In the case of distributed system it is Software for Distribution Transparency that enables this abstraction.
  • 19. 19 Servers Servers are powerful computers or systems that provide resources, services, or data to other computers, known as clients, over a network. General Design A server is a process implementing a specific service on behalf of a collection of clients. In essence, each server is organized in the same way: it waits for an incoming request from a client and subsequently ensures that the request is taken care of, after which it waits for the next incoming request. There are several ways to organize servers 1. Iterative server, the server itself handles the request and, if necessary, returns a response to the requesting client. 2. A concurrent server does not handle the request itself, but passes it to a separate thread or another process, after which it immediately waits for the next incoming request. A multithreaded server is an example of a concurrent server. The thread or process that handles the request is responsible for returning a response to the requesting client.
  • 20. 20 Servers A server is the backbone of a distributed system. It processes requests, manages resources, and ensures that clients receive the services they need. Servers come in different types, each with a specific role. Web servers : host websites and deliver web pages when users enter URLs. When you visit Facebook, your browser sends a request to a web server, which responds with the necessary content. Database servers: which store and retrieve data. For example :every time you search for a product on Amazon, a database server fetches relevant results from a massive collection of stored data. Application servers : handle complex business logic. In an online shopping system, an application server might calculate discounts, process payments, and update stock levels. A good analogy for a server is a waiter in a restaurant. When a customer orders food, the waiter takes the request to the kitchen, gets the food prepared, and serves it back to the customer. Similarly, a server takes client requests, processes them, and returns responses.
  • 21. 21 Where clients contact a server? In all cases, clients send requests to an end point, also called a port, at the machine where the server is running. Each server listens to a specific end point. How do clients know the end point of a service? ?
  • 22. 22 1. Globally assign end points for well-known services. These end points have been assigned by the Internet Assigned Numbers Authority (IANA), Example  servers that handle Internet FTP requests always listen to TCP port 21.  HTTP server for the World Wide Web will always listen to TCP port 80. 2.Service Discovery This approach allows applications to dynamically find and connect to services in a network, rather than relying on hard-coded endpoints. Example DNS SRV Records • Scenario: A Microservices-Based E-Commerce Application Imagine an e-commerce application consisting of various microservices, including a user service, product service, and payment service. Each of these services runs on different servers or containers in a cloud environment. To facilitate communication among these services, DNS SRV records can be utilized for service discovery.
  • 23. 23 Client-to-server bindings using daemons and super servers 1. Client-to-Server Binding Using Daemons In this model, each service is managed by its own daemon process. A daemon is a background service that listens for client requests on a specific port.
  • 24. 24 Client-to-server bindings using daemons and super servers 2. Client-to-Server Binding Using Super servers A super server is a single daemon that listens on a well-known port and manages multiple services. It acts as a gateway for clients to communicate with various services.
  • 25. 25 Daemon Binding Vs Super server Binding Feature Daemon Binding Super server Binding Architecture Each service has its own daemon. One superserver manages multiple services. Connection Method Direct connection to the daemon. Connect to the superserver which delegates. Resource Usage More resource-intensive (multiple daemons). More efficient (single process for many services). Failure Isolation Failures are isolated to individual daemons. Failure of the superserver affects all services. Client Configuration Clients need to know specific ports. Clients connect to a single entry point.
  • 26. 26 Servers and State One of the biggest decisions in designing a distributed system is whether a server should be stateless or stateful. In the context of stateless and stateful servers, state refers to any data or information about a client's session that a server retains between multiple requests. It helps the server remember past interactions, making responses more context-aware. stateful servers a stateful server is a server that keeps track of previous client interactions. And this property is necessary for services that require continuity, like online banking or shopping carts. When you add an item to your cart on Amazon and come back later, the server remembers what you selected because it maintains session data. While stateful servers provide a personalized experience, they require more memory and resources to store session data.
  • 27. 27 Servers and State Stateless server A stateless server treats every client request as independent, meaning it does not store any previous interaction data. This makes it highly scalable and efficient because there’s no need to maintain user-specific information. Web servers, like those that serve static websites, are often stateless. Every time you visit a page, the server processes your request from scratch, without remembering past interactions. Stateless servers are faster and more scalable but lack continuity.
  • 28. 28 Server Clusters A server cluster is nothing else but a collection of machines connected through a network, where each machine runs one or more servers. The server clusters that we consider here, are the ones in which the machines are connected through a local- area network, often offering high bandwidth and low latency. In most cases, a server cluster is logically organized into three tiers, as shown in Fig below
  • 29. 29 1. Presentation(first) Tier This is the top layer where the user interacts with the application. It handles user interface and user experience. The first tier consists of a (logical) switch through which client requests are routed. Example: A web application interface that users access through a browser. 2. Application(second) Tier Also known as the middle tier, this layer contains the business logic of the application. It processes user requests and executes the necessary operations. Example An application server that handles business logic and interacts with various services.
  • 30. 30 3. Data (third) Tier This is the bottom layer responsible for data storage and management. It includes databases and data-related services. Example: A relational database management system (RDBMS) like MySQL or PostgreSQL.
  翻译: