



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The concept of processes and threads in the context of distributed systems. It covers the definition of a process, the importance of process state and process control blocks, and the role of threads in enhancing performance and simplifying programming. The document also discusses the implementation of threads and their usage in both non-distributed and distributed systems.
Typology: High school final essays
1 / 27
This page cannot be seen from the preview
Don't miss anything!




















2/21/
What is process?
a process
is a program
in execution
sharing resources by processes is transparent.
processes should not interfere with each other.
Process tables or PCBs(Process control block) are used to keeptrack of processes.
important issues arise in distributed systems include:
Multi threading
to enhance performance by overlapping
communication and local processing.
how are clients and servers organized and server design issues?
process
or
code migration
to achieve scalability
2/21/
Threads and their Implementation •
a thread also executes independently from other threads
threads can be used in both distributed and non distributed systems
Threads in Non distributed 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, etc.
Process 1
Process 2
Process 3
processes each with one thread
one process with three threads
2/21/
each thread has its own
program counter
registers
stack
, and
state(thread id)
; but all threads of a process share
address space,
global variables
and other resources such as
open files
, etc.
2/21/
e.
spelling and grammar checking, etc.
2/21/
In
non
distributed
systems,
threads
can
be
used
with
shared
data
instead
of
processes
to
avoid
context switching
overhead in
inter process communication
During IPC
allocating
resources for a new process and
context
switching
take time. context switching as the result of IPC
2/21/
LWP
2/21/
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 TCPconnection to the server.
each can display the results as it gets its part of the page
parallelism can also be achieved for replicated servers sinceeach thread request can be forwarded to separate replicas
Multithreaded Servers
servers can be constructed in three ways
A. single-threaded process
it gets a request, examines it, carries it out to completionbefore getting the next request.
the server is idle while waiting for disk read, i.e., systemcalls are blocking
2/21/
threads are more important for implementingservers
e.g., a file server
the dispatcher thread reads incoming requests for afile operation from clients and passes it to an idleworker thread.
2/21/
if threads are not available
it gets a request, examines it, tries to fulfill the requestfrom cache, else sends a request to the file system
but instead of blocking it records the state of thecurrent request and proceeds to the next request
2/21/
2/21/
General organization between aprogram, interface, and system.
General organization of virtualizingsystem A on top of system B.
Structure of Clients and Servers Two issues:
user interfaces
and
client-side software
for distribution
transparency
A. Networked User Interfaces •
to create a convenient environment for the interaction of ahuman user and a remote server; e.g.
mobile phones
with simple
displays and a set of keys
GUIs are most commonly used
it has the
X kernel
: the part of the OS that controls the terminal
monitor,
keyboard,
pointing
device
like
a
mouse)
and
is
hardware dependent
2/21/
17
Servers and Design Issues 1 General Design Issues A server is a process implementing a specific service on behalf of a
collection of clients.
a. 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 thenext incoming request; e.g., a multithreaded server;
2/21/
b
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.
is on TCP port 21,
is on TCP port 80
2/21/