0% found this document useful (0 votes)
0 views

Process Management

The document discusses process management in conventional and distributed operating systems, focusing on process migration and its mechanisms. It outlines the steps, types, and desirable features of a good process migration mechanism, as well as the complexities involved in freezing, transferring, and restarting processes. Additionally, it covers code migration, its importance, models, and security measures to protect both mobile agents and hosts from malicious code.

Uploaded by

zoro80290
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Process Management

The document discusses process management in conventional and distributed operating systems, focusing on process migration and its mechanisms. It outlines the steps, types, and desirable features of a good process migration mechanism, as well as the complexities involved in freezing, transferring, and restarting processes. Additionally, it covers code migration, its importance, models, and security measures to protect both mobile agents and hosts from malicious code.

Uploaded by

zoro80290
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Process Management

Process management
▪ Conventional OS: deals with the mechanisms and policies for sharing
the processor of the system among all processes
▪ Distributed OS : To make best possible use of the processing
resources of the entire system by sharing them among all processes.
Three concepts to achieve this goal:
▪ Processor allocation: Deals with the process of deciding
which process should be assigned to which processor
▪ Process migration: Deals with the movement of a process from its current
location to the processor to which it has been assigned
▪ Threads: Deals with fine-grained parallelism for better utilization of the
processing capability of the system
Process Migration
Process Migration
▪ The act of transferring a process between two machines during its execution
▪ Relocation of a process from its current location (source node) to another node (destination
node)

• Involves three steps:


1. Selection of a process that should be migrated
2. Selection of the destination node to which the
selected process should be migrated
3. Actual transfer of the selected process to the destination
node
Process Migration
• Types of process migration:
1. Preemptive process migration
Process may be migrated during the course of its execution
2. Non pre-emptive process migration
Process may be migrated before it starts executing on its source node

• Preemptive process migration is costlier than non-preemptive process migration since


the process environment must also accompany the process to its new node for an
already executing process.
Desirable Features of a Good Process Migration Mechanism
• Transparency
Object class level
System call and interprocess communication level
• Minimal interference
Can be done by minimizing freezing time
Freezing time: Freezing time is defined as the time period
for which the execution of the process is stopped for transferring its information to the
destination node.
• Minimal residual dependencies
Migrated process should not continue to depend on its previous node once it has started
executing on new node
• Efficiency
Time required for migrating a process
Thecost of locating an object
The cost of supporting remote execution once the process is migrated All
these costs should be kept to minimum as far as practicable.
• Robustness
The failure of a node other than the one on which a process is currently running
should not affect the execution of that process.
Process Migration Mechanism
Migration of a process is a complex activity that involves proper handling of
several sub-activities in order to meet the requirements of a good process
migration mechanism listed above.
The four major subactivities involved in process migration are as follows:
1. Freezing the process on its source node and restarting it on its destination
node.
2. Transferring the process's address space from its source node to its
destination node.
3. Forwarding messages meant for the migrant process.
4. Handling communication between cooperating processes that have been
separated (placed on different nodes) as a result of process migration
Process Migration Mechanisms
Mechanisms for freezing and restarting a process
1. Immediate and Delayed blocking of the process
Depending upon the process's current state, it may be blocked immediately or the blocking may
have to be delayed until the process reaches a state when it can be blocked.
1. If the process is not executing a system call, it can be immediately blocked from further
execution.
2. If the process is executing a system call but is sleeping at an interruptible priority (a
priority at which any received signal would awaken the process) waiting for a kernel event to
occur, it can be immediately blocked from further execution.
3. If the process is executing a system call and is sleeping at a non interruptible priority waiting
for a kernel event to occur, it cannot be blocked immediately. The process's blocking has to be
delayed until the system call is complete. Therefore, in this situation, a flag is set, telling
the process that when the system call is complete, it should block itself from further execution.
Process Migration Mechanisms
Mechanisms for freezing and restarting a process
2. Fast and Slow I/O operation
• In general, after the process has been blocked, the next step in freezing the
process is to wait for the completion of all fast I/O operations (e.g., disk 110)
associated with the process.

• The process is frozen after the completion of all fast I/O operations.
Note that it is feasible to wait for fast I/O operations to complete before freezing the
process. However, it is not feasible to wait for slow I/O operations, such as those on a
pipe or terminal, because the process must be frozen in a timely manner for the
effectiveness of process migration.
Process Migration Mechanisms
Mechanisms for freezing and restarting a process
Information about the open files
In a distributed system that provides a network transparent execution
environment, there is no problem in collecting this state information because the same
protocol is used to access local as well as remote files using the systemwide unique
file identifiers.
However, several UNIX-based network systems uniquely identify files by their full
pathnames but in these systems it is difficult for a process in execution to obtain
a file's complete pathname owing to UNIX file system semantics.
The following two approaches are used for this:
• In the first approach a link is created to the file and the pathname of the
link is used as an access point to the file after the process migrates.
• In the second approach an open file's complete pathname is reconstructed when
required.
Process Migration Mechanisms
Address Space Transfer Mechanisms
➢ Information to be transferred from source node to destination node:
• Process’s state information
• Process’s address space
➢ Three methods for address space transfer
• Total Freezing
• Pre transferring
• Transfer on reference
Process Migration Mechanisms
❑Total Freezing
Sourcenode destinationnode
❑Execution is stopped
Time
while its address Execution
space is being suspended Migration
decision made
transferred
❑Process is suspended
for a long time Transfer of
address
Freezing
during migration Time
space
Execution
❑Simple and easy to resumed

implement
❑Not suitable for
interactive process
Process Migration Mechanisms
❑ Pretransferring (precopying) destinationnode
Sourcenode
❑ Address space is transferred
Time
while the process is still running
on the source node Migrationdecision
made
❑ Initial transfer of the complete
address space followed by Execution suspended
repeated transfers of the pages Transfer of
Freezing addressspace
modified during previous transfer
Time
❑ Remaining modified pages are Execution
resumed
retransferred after the process is
frozen for transferring its state
information
❑ freezing time is reduced
❑ Pretransfer operation is executed at a higher priority than all other programs
on the source node
❑ Total time of migration is increased due to the possibility of redundant page
transfers
Process Migration Mechanisms
❑ Transfer on reference Sourcenode destination node
❑ Based on the assumption that Time
the process tends to use only a
Execution Migration decision
relatively small part of their Freezing suspended made
address space while executing. Time
Execution resumed
❑ A page of the address space is
transferred from its source On demand
node to destination node only Transfer of
when referenced address space

❑ Demand driven copy on


reference approach
❑Switching time is very short and independent of the size of the address space
❑Not efficient in terms of cost
❑Imposes continued load on process’s source node
❑Results in failure if source node fails or reboots
Process Migration Mechanisms
❑ Message forwarding mechanisms
❑ Ensures that all pending, en-route and future messages arrive at the process’s new
location
❑ Classification of the messages to be forwarded
❑ Type 1: Messages received at the source node after the process’s execution has been
stopped on its source node and process’s execution has not yet been started on its
destination node
❑ Type 2: Message received at the source node after the process’s execution has started on its
destination node
❑ Type 3: Messages that are to be sent to the migrant process from any other node after it
has started executing on the destination node
❑ Mechanism of Resending the Message
❑ Messages of type 1 and 2 are returned to the sender as not deliverable or are simply
dropped
❑ Locating a process is required upon the receipt of the nonnegative reply (messages of type 3)
❑ Drawback: nontransparent to the processes interacting with the migrant process
Message forwarding mechanisms
❑ Origin Site Mechanism
❑ Process identifier has the process’s origin site(or home node) embedded in it
❑ Each site is responsible for keeping information about the current location of all the
processes created on it
❑ Messages are sent to the origin site first and from there
they are forwarded to the current location
▪ Drawbacks:1. not good from reliability point of view 2. continuous load on migrant
process’s original site
❑ Link Traversal mechanism
❑ Uses message queue for storing messages of type 1 & forwarded to destination
❑ Use of link (a forwarding address) for messages of type 2 and 3
❑ Link has two components: process identifier and location of the process
❑ Forwarding address is left at source node pointing to destination node.
▪ Drawbacks: 1. poor efficiency 2. poor reliability
❑ Link Update mechanism
❑ Processes communicate via location independent links
❑ During the transfer phase, the source node sends link update message to all relevant
kernels
Mechanisms for handling coprocesses
❑ Communication between a process and its subprocesses
❑ Two different mechanisms
❑ Disallowing separation of Coprocesses
▪ By disallowing the migration of processes that wait for one or more of their children to
complete.
▪ By ensuring that when a parent process migrates, its children processes will
be migrated along with it
❑Concept of logical host
❑Process id is structured as {logical host-id, local-index} pair
▪ Drawback :1. Does not allow parallelism within jobs 2. Overhead is large when logical
host contains several processes
❑ Home node or origin site concept
▪ Complete freedom of migrating a process or its subprocesses independently and
executing them on different nodes
▪ Drawback:Message traffic and communication cost is significant
Code Migration
• Code migration involves transferring software code from one environment to
another, which is crucial in distributed systems where different parts of an
application run on separate computers or servers. This process helps in managing
and updating the system efficiently.
• E.g searching for information on the internet. A search query can be easily
implemented in the form of a small mobile programme called a mobile agent
which moves from site to site. We may be able to achieve a linear speedup over
using a single programme instance by making several copies of such programme &
sending each to a different site.
Code Migration
Why Code Migration?
• Reduce Network Bandwidth
• Migrate part of client application to server
• Migrate part of client application to database server to perform many database operations
• Send only result across network
• Migrate part of server application to client
• Migrate part of database server to client to process forms
on client side
• Reduces database operations over the network
• XSS - Javascript
• Parallelism
• Mobile Agent
• Dynamic Configuration of Distributed Systems
• Download and Initialize Code
Code Migration Models
Code Migration Framework
❑ Code Segment
▪ Set of instructions being executed
❑ Resource Segment
▪ References to external resources
▪ Files, printers, devices, etc
❑ Execution Segment
▪ Process state
▪ Private data
▪ Stack
▪ Instruction pointer
Code Migration Models
1. Weak Mobility
• Transfer code segment only. The transferred program always starts from
predefined starting position.
• It only requires that the target machine to execute the code which makes it
portable.
• E.g Java Applets
2. Strong Mobility
• It transfers code as well as execution segment.
• A process can be stopped, moved to another machine, and resumed back by
its execution.
Code Migration Models
• Sender-initiated
• Code transfer is initiated by machine currently executing the code or is being
executed
• The server is required to know all its clients, the reason being is that the client will
presumably want access to the server’s resources such as its disk. Protecting such
resources is essential.
• Example
• Securely uploading programs to a computational server, sending a search program across
the Internet to a Web database server to perform the queries at that server
• Receiver-initiated
• Transfer is initiated by machine that will execute code. It can be done anonymously.
Server is generally not interested in the client’s resources.
• Example
• For example, Java applets or Flash Application are simply downloaded by a Web
browser and are executed in the browser’s address space. The benefit of this
approach is that there is no need to start a separate process, thereby avoiding
communication at the target machine. The main drawback is that the target process
needs to be protected against malicious or inadvertent code executions.
Code Migration Models
Remote Cloning:
• 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. In UNIX
systems, remote cloning takes place by forking off a child process and
letting that child continue on a remote machine.
• The benefit of cloning is that 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.
Code Migration Models
Heterogeneous Systems
• Heterogeneous systems are platforms with different operating
systems and/or different machine architectures
• Problems with heterogeneous systems is similar to those of
portability
• Solutions
➢Highly portable languages
o Scripting languages, interpreted languages (Java)
➢Migrating computing environments
➢Migrating virtual machines
Migration Security
• Protecting mobile agents
o need to protect sensitive data
• Three mechanisms for securing mobile agents
o Read-only state
• Data items are signed by agent's owner
o Append-only state
• Data can only be appended to logs
o Selective reading
• Each data entry can only be updated by selected servers
Migration Security
Protecting hosts against malicious mobile code
➢ Sandbox
• Monitor specific instructions, registers, memory regions
• Easier to do with interpreted languages
o Java sandbox
➢ Playground
• Separate machines exist to execute mobile code
➢ Code-signing
➢ Stack introspection
➢ Name space management

You might also like