Professional Documents
Culture Documents
DCC - Module A3 - Distributed Processes
DCC - Module A3 - Distributed Processes
Distributed Processes
Module A3
System Layers
Applications, services
Middleware
OS1 OS2
OS: kernel,
Processes, threads, Processes, threads,
libraries &
communication, ... communication, ...
servers
Platform
Node 1 Node 2
1
1/1/2023
Core OS Functionality
Process manager
Communication
manager
Supervisor
Process vs Thread
• Process
o is the part of program in execution
o in whose context one or more threads may be executed
• Thread
o A minimal part of a process in whose context a series of instructions can be
executed
2
1/1/2023
Context Switch
• Context switching is the switching between two processes / thread
• Process context
o The minimal collection of values stored in registers and memory, used for the
execution of a series of instructions
o Saving a process context implies stopping the current execution of process
and saving all the data needed to continue the execution at a later stage
• Thread context
o The minimal collection of values stored in registers and memory, used for the
execution of a thread
o Saving a thread context implies stopping the current execution of thread and
saving all the data needed to continue the execution at a later stage
Context Switch
• Threads share the same address space
o Thread context switching can be done entirely independent of the operating
system
• Process switching is generally more expensive
o it involves getting the OS in the loop, i.e., trapping to the kernel
• Creating and destroying threads is much cheaper than doing so for
processes
3
1/1/2023
4
1/1/2023
10
5
1/1/2023
11
12
6
1/1/2023
13
Multithreaded Servers
Model Characteristics
14
7
1/1/2023
15
16
8
1/1/2023
17
18
9
1/1/2023
19
20
10
1/1/2023
3.7
21
22
11
1/1/2023
Stateless Server
• Never keep accurate information about handled a request
• Don’t record whether a file has been access
• Don’t keep track of your clients
• Don’t promise to invalidate a client’s
23
Stateful Server
• Keeps track of the status of its clients
• Record that a file has been opened, so that prefetching can be done
• Knows which data a client has cached, and allows clients to keep local
copies of shared data
24
12
1/1/2023
Object Adapter
25
Code Migration
• It is the transfer of code / process from one machine to another
• Traditionally, code migration in distributed systems took place in the
form of process migration
o in which an entire process is moved from one machine to another
• Moving a running process to a different machine is a costly and
complex task
• More difficult in heterogeneous systems
• Performance can be improved if processes are moved from heavily-
loaded to lightly-loaded machines
26
13
1/1/2023
Code Migration
27
28
14
1/1/2023
29
30
15
1/1/2023
31
32
16
1/1/2023
• Fixed resources
o are intimately bound to a specific machine or environment and cannot be
moved
o Examples are often local devices or a local communication end point
33
Actions to be taken with respect to the references to local resources when migrating
code to another machine
34
17
1/1/2023
3-15
The principle of maintaining a migration stack to support migration of an execution segment in a heterogeneous environment
35
18