Presentation On Prcosess Managemnt in Unix

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 28

12/07/2021

Process Management in Unix

Shivam Amin
Krishna Joshi
Mehul Dawda
Kijit Desai
Sumeet Kapoor

1
12/07/2021

Linux Process Management


 Linux is a multitasking system
 Multiple programs can be executed at the same
time
 Ultimately, a program needs to be executed by a
CPU
 If there is only one CPU, how multiple programs
can be executed at the same time?
Þ By time sharing
 That is, all programs are claimed to be executing.
In fact, most of them are waiting for the CPU
2
12/07/2021

 A program that is claimed to be executing is


called a process
 For a multitasking system, a process has at least
the following three states:

Start Finish
execution Ready Running execution

Sleeping

3
12/07/2021

 Ready state
– All processes that are ready to execute but without
the CPU are at the ready state
– If there is only 1 CPU in the system, all processes
except one are at the ready state
 Running state
– The process that actually possesses the CPU is at the
running state
– If there is only 1 CPU in the system, at most there is
only one process is at the running state
 Sleeping state
– The process that is waiting for other resources, e.g.
I/O, is at the sleeping state

4
12/07/2021

PROCESS MANAGEMENT
• Process management is one of the most important
and relevant tasks in operating system design
which investigates the process management in
Unix/Linux.

• It is done by comparing the data structures used to


represent process and the global variables used to
control the current active process in all Unix
operating systems.
5
12/07/2021

COUPLING
 Coupling is a measure of the degree of dependency
between two software components(classes, modules,
packages, or the like)
 A good software system should have high cohesion
within each component and low coupling between
components.
 In operating systems, in order to achieve high efficiency,
the process management is usually implemented via a
global variable that accesses all the current active
processes in the system.
6
12/07/2021

PROCESS CONTROLLER & BLOCK

7
12/07/2021

PROCESS MANAGEMENT IN OS(1)


 In operating systems, process is defined as “A
program in execution”. Process can be considered
as an entity that consists of a number of elements,
including: identifier, state, priority, program
counter, memory pointer, context data, and I/O
request.
 The above information about a process is usually
stored in a data structure, typically called process
block.
8
12/07/2021

PROCESS MANAGEMENT IN OS(2)


 Process management involves scheduling (CPU
scheduling, I/O scheduling, and so on), state
switching, and resource management.

 As a result, in most operating systems, there is a


data object that contains information about all the
current active processes. It is called process
controller.

9
12/07/2021

OPERATING SYSTEM- LINUX


 Linux, FreeBSD, and Darwin are three open-
source operating systems. All these three operating
systems are kernel-based.
 Linux is a completely new implementation of
UNIX using module structure.
 The advent of KDE (K Desktop Environment) and
GNOME (GNU Object Model Environment)
makes Linux a user friendly desktop operating
system.
10
12/07/2021

OPERATING SYSTEM- FREEBSD


 FreeBSD is a free open-source Unix-like OS
descended from AT&T UNIX via BSD.
 It is called as “Unknown giant among Operating
Systems”.
 BSD is Berkeley Software Distribution that was
developed at University of California, Berkeley.
 Has powerful and robust networking, security and
performance services(it can handle thousands of
processes and applications easily and efficiently).
11
12/07/2021

OPERATING SYSTEM- DARWIN


 Darwin is the OS from Apple named operating
system core for Mac OS X. Darwin is Mac OS X
without the user interface.
 Darwin is an open-source core used in Apple OS
X.
 It consists of 5 major components: Mach
Microkernel with the BSD subsystem, file
system, network ability and the I/O Kit.

12
12/07/2021

DATA STRUCTURES USED


 In Linux, process block is implemented as a data structure –
task_struct.
 In FreeBSD, it is implemented as a data structure -proc.
 In Darwin, it is implemented as a data structure -task.
 All three data structures contain the similar information
about a process, such as process id, process state, file
information, and so on.
 The process block (task_struct in Linux, proc in FreeBSD,
and task in Darwin) are the most complicated data structure
in their corresponding operating systems.

13
12/07/2021

THE TASK LIST(LINUX)


 The kernel stores the list
of processes in a circular
doubly linked list called
the task list.
 process descriptor of the
type struct task_struct,
which is defined
in <linux/sched.h>.
 The process descriptor and task list

14
12/07/2021

FREEBSD SYSTEM
 supports transparent multiprogramming by context
switching—that is, by switching between the execution
context of processes.
 Context switching is done frequently, so increasing the
speed of a context switch noticeably decreases time
spent in the kernel.
 The FreeBSD time-share scheduler uses a priority-based
scheduling policy

15
12/07/2021

OUTCOME OF COMPARISON
 The number of instances of process control global
variable can affect the maintenance of the operating
system kernel.
 This effect is demonstrated in the relationship between
the number of kernel lines of code modified and the
number of instances and number of definitions of
process controller global variable.
 We conclude that the way process management
implemented in Linux makes it more difficult to
maintain than FreeBSD and Darwin.
16
LOAD-SHARING CLUSTERS OF
HETEROGENEOUS UNIX
WORKSTATIONS
INTRODUCTION
 Load-Sharing is when multiple computers are linked together to
share computational workload or function as a single virtual
computer.

 Logically, from the user side, they are multiple machines, but
function as a single virtual machine. Requests initiated from the
user are managed by, and distributed among, all the standalone
computers to form a cluster.

 This results in balanced computational work among different


machines, improving the performance of the cluster systems.
TYPES OF PROCESS MIGRATION
AMONG CLUSTER MACHINE-

1. Systems for preemptive migration :


 Some systems such as Mosix implement pre emptive process migration
by modifying existing operating systems.

 Preemptive process migration can cause the execution site of a job to change
even during its execution.

 They cannot offer full transparency because of lack of access to kernel


data structures related to a process.

 A common drawback of all these preemptive process migration systems


is that they do not support heterogeneity, that is, a process cannot be
migrated from a machine to a machine with a different architecture.
2. SYSTEMS FOR NON PREEMPTIVE PROCESS MIGRATION:-

 IT is simpler to implement and can accommodate heterogeneity of architectures


and operating systems among the machines comprising the distributed system,
while retaining most of the performance benefit of preemptive process migration.

 In non preemptive process migration, a job, when initiated, can be


migrated to some other machine on the network where it executes
to completion.

• The main drawback of non preemptive process is that they assume the same
operating system to be running on all machines in the cluster
DISTRIBUTED PROCESS MANAGEMENT PROTOCOL (DPMP)

• Due to the drawback of above two system we use DPMP.

 Distributed Process Management Protocol (DPMP), not only enables non-preemptive


migration but also allows management of processes in a distributed manner.

 DPMP defines a set of messages that are exchanged by the machines in the cluster, and a set of
conventions that all machines in the cluster must follow so that migrated processes can run in
an environment very similar to the one that they would have found on their originating
machines.

• DPMP may be implemented either inside the kernel, or at the user level by using a
library that intercepts system calls. A kernel implementation is likely to be more
efficient than a user level implementation.

• A user level implementation would be more portable but may also entail some loss in
transparency.
THE CHIEF CHARACTERISTICS OF OUR APPROACH THAT DISTINGUISH IT FROM OTHER SYSTEMS FOR PROCESS MIGRATION ARE:-

 High degree of transparency

 Support for architectural heterogenity

 Operating system heterogeneity

 Support for detection

 Recovery from failures

 Correct operation under partial failures


 
DESIGN GOALS AND APPROACH:-

• Transparency The system should be able to non preemptively migrate processes


with a high degree of transparency.
 
• Heterogeneity The system should be able to accommodate heterogeneity in both
architectures and operating systems of the workstations that share their loads.
 
• Separation of Mechanisms and Policies The mechanisms for process migration
should be independent of the policies for process migration.
 
• Performance The protocol overhead should be as low as possible.
 
• Scalability The system should be able to scale up to a large number of nodes.
 
• Fault Tolerance Partial failures (node and network failures) should not affect the
working of the rest of the system.
DPMP CONSISTS OF FOLLOWING PARTS :-

• Uniform File System View:- Clearly a


uniform file system view is important for
process migration to work transparently.
 
• Process identifiers:- In order to provide
transparency to users, a process should retain
its Process identifier (pid) when it migrates
• DPMP Messages:- DPMP is a UDP based request-reply protocol.
Timeouts and retransmissions are used to handle lost messages.
 
• Message Types:- Different types of format is used to denote the
message which are send or Received.
 
• Transferring Open File Information:- This is the way you send
the info of file,device,socket etc which are open when exec
command is given.

• Failure Detection and Recovery:- Correct execution in the case


of partial failures and recovery from failures was an important
design goal of DPMP.
• A Kernel Implementation of DPMP:- The
implementation architecture attempts to minimize
changes to the existing kernel and adds module on top of
the existing kernel code.
 

• Performance Evaluation:- The performance of the


implementation was tested by using pmake to compile the
Net BSD kernel sources (about 700 C files) on a cluster
of three Intel Pentium.
12/07/2021

CONCLUSION

• The proposed Distributed Process Management


Protocol allows non-preemptive migration of
processes to machines with possibly different
architectures and running different flavors of
Unix.

27
12/07/2021

• THANKYOU

28

You might also like