Unit 03 Processes
Unit 03 Processes
Dispatched
request
Client request
Code repository
Models for Code Migration
To get a better understanding of the different models for code migration, we use a framework
described in Fuggetta et al. (1998).
In this framework, a process consists of three segments.
1. The code segment: It is the part that contains the set of instructions that make up the
program that is being executed.
2. The resource segment: It contains references to external resources needed by the
process, such as files, printers, devices, other processes, and so on.
3. The execution segment: It is used to store the current execution state of a process,
consisting of private data, the stack, and, of course, the program counter.
Weak Mobility Vs. Strong Mobility
Definition In this model, it is possible to transfer In contrast to weak mobility, in systems that support
only the code segment, along with strong mobility the execution segment can be
perhaps some initialization data . transferred as well .
Characteristic A transferred program is always started A running process can be stopped, subsequently
Feature from its initial state moved to another machine, and then resume
execution where it left off .
Receiver-Initiated Migration
The initiative for code migration is taken by the target machine
Example: Java applets.
Alternatives for code migration
Execute at target process
Sender-Initiated
mobility
Execute in separate process
Weak mobility
Execute at target process
Receiver-Initiated
mobility
Mobility Execute in separate process
mechanism
Migrate process
Sender-Initiated
mobility
Clone process
Strong mobility
Migrate process
Receiver-Initiated
mobility
Clone process
Execute Migrated Code for weak mobility
In the case of weak mobility, it also makes a difference if the migrated code is executed by
the target process, or whether a separate process is started.
For example, Java applets are simply downloaded by a web browser and are executed in the
browser's address space.
Benefit for executing code at target process: There is no need to start a separate process,
thereby avoiding communication at the target machine.
Drawback for executing code at target process: The target process needs to be protected
against malicious or inadvertent code executions.
Migrate or Clone Process (for strong mobility)
Instead of moving a running process, also referred to as process migration, strong mobility
can also be supported by remote cloning.
In contrast to process migration, cloning yields an exact copy of the original process, but
now running on a different machine.
The cloned process is executed in parallel to the original process.
Benefit of cloning process: The model closely resembles the one that is already used in many
applications. The only difference is that the cloned process is executed on a different
machine.
In this sense, migration by cloning is a simple way to improve distribution transparency.
Migration and Local Resources
What often makes code migration so difficult is that the resource segment cannot always be
simply transferred along with the other segments without being changed.
When the process moves to another location, it will have to give up the port and request a
new one at the destination.
Process-to-Resource Bindings
1. Binding by Identifier
2. Binding by Value
3. Binding by Type
Process-to-Resource Bindings
Binding by Identifier
A process refers to a resource by its identifier. In that case, the process requires precisely the
referenced resource, and nothing else.
Examples:
▪ A URL to refer to a specific web site.
▪ Local communication endpoints (IP, port etc.)
Binding by Value
Only the value of a resource is needed. In that case, the execution of the process would not
be affected if another resource would provide the same value.
Example: Standard libraries for programming languages.
Binding by Type
A process indicates it needs only a resource of a specific type.
Example: References to local devices, such as monitors, printers and so on.
Resource Types
When migrating code, we often need to change the references to resources, but cannot affect
the kind of process-to-resource binding.
Resource Types:
Unattached resources :
▪ They can be easily moved between different machines.
▪ Example: Typically (data) files associated only with the program that is to be migrated.
Fastened resources:
▪ They may be copied or moved, but only at relatively high costs.
▪ Example: Local databases and complete web sites.
▪ Although such resources are, in theory, not dependent on their current machine, it is
often infeasible to move them to another environment.
Fixed resources:
▪ They are intimately bound to a specific machine or environment and cannot be moved.
▪ Example: Local devices, local communication end points
Managing Local Resources
Combining three types of process-to-resource bindings, and three types of resource-to-machine bindings, leads
to nine combinations that we need to consider when migrating code
Resource-to-machine Binding