You are on page 1of 40

Akhilesh Yadav

Process
 Process means any program is in execution.
 Process control block controls the operation of any process.
 A process is basically a program in executed.
 Process control block contains information about processes for example
Process priority, process id, process state, CPU, register, etc.
 A process can create other processes which are known as ​Child
Processes​.
 The process takes more time to terminate and it is isolated means it does
not share a memory with any other process.
The process can have the following states like new, ready, running,
waiting, terminated, suspended.

1-2
Properties of Process
Here are the important properties of the process:
● The creation of each process requires separate system calls for each
process.
● It is an isolated execution entity and does not share data and information.
● Processes use the IPC(Inter-Process Communication) mechanism for
communication that significantly increases the number of system calls.
● Process management takes more system calls.
● A process has its stack, heap memory with memory, and data map.

1-3
stack: Contains the temporary data such as method/functions
parameters return address stores local variables
•heap: dynamic memory for programmer to allocate
•data: stores global variables, separated into initialized and uninitialized
•text: This includes the current activity represented by the value of Program
counter and the contents of the processor’s register. (stores the code being
executed)

1-4
Process Life Cycle
When a process executes, it passes through different states. These
stages may differ in different operating systems, and the names of
these states are also not standardized.
In general, a process can have one of the following five states at a
time.

1-5
S.N. State & Description
1 Start
This is the initial state when a process is first started/created.
2 Ready
The process is waiting to be assigned to a processor. Ready processes are
waiting to have the processor allocated to them by the operating system so
that they can run. Process may come into this state after Start state or while
running it by but interrupted by the scheduler to assign CPU to some other
process.
3 Running
Once the process has been assigned to a processor by the OS scheduler,
the process state is set to running and the processor executes its
instructions.
4 Waiting
Process moves into the waiting state if it needs to wait for a resource, such
as waiting for user input, or waiting for a file to become available.
5 Terminated or Exit
Once the process finishes its execution, or it is terminated by the operating
system, it is moved to the terminated state where it waits to be removed
from main memory.
1-6
Thread
Thread is the segment of a process means a process can
have multiple threads and these multiple threads are
contained within a process.
A thread has 3 states:
Running,
Ready
Blocked.
The thread takes less time to terminate as compared to
process and like process threads do not isolate.

1-7
Properties of Thread
● Single system call can create more than one thread
● Threads share data and information.
● Threads shares instruction, global, and heap regions.
However, it has its register and stack.
● Thread management consumes very few, or no system calls
because of communication
between threads that can be achieved using shared
memory.

1-8
Threads are schedule activities attached to process.
The main of having multiple threads of execution is:
 To maximize degree of concurrent execution between operations
 To enable the overlap of computation with I/O
 To enable concurrent processing multiprocessors threads can be
helpful with servers.
 Concurrent processing of clients requests can reduce the tendency for
servers to become bottleneck.

1-9
Advantages of Thread
 Threads minimize the context switching time.
 Use of threads provides concurrency within a process.
 Efficient communication.
 It is more economical to create and context switch threads.
 Threads allow utilization of multiprocessor architectures to a greater
scale and efficiency.
 Thread minimizes context switching time.
 Use of threads provides concurrency within a process.
 Efficient communication.
 Economy- It is more economical to create and context switch threads.
 Utilization of multiprocessor architectures to a greater scale and
efficiency

1-10
Disadvantages of Threads :
Blocking of parent threads will stop all child thread.
 Security.

Types of Threads :Threads are implemented in following two ways :


1.User Level Threads (ULT)
2.Kernel Level Threads (KLT)

1-11
User

Level Threads (ULT) :
User level thread implement in user level libraries, so thread switching
does not need to call operating system and to cause interrupt to the
kernel.
 In fact, the kernel knows nothing about user level threads and
manages them as if they
Advantages of ULT :
 User level threads does not require modification to operating system.
 Easy to represent and manage.
 User level thread can run on any operating system.
 User level threads are fast and efficient.
Disadvantages of ULT :
 There is a lack of coordination between threads and operating system
kernel.
 ULT require non-blocking system call (i.e. Multithreaded kernel) were
single-threaded process.
1-12
Kernel Level Threads (KLT) :
 Kernel Level Threads (KLT) : In this method, the kernel knows about
and manages the threads. No runtime system is needed in this case.
Operating system kernel provides system call to create and manage
threads.
Advantages of KLT :
 Kernel can simultaneously schedule multiple threads from the same
process on multiple processes.
 If one thread in a process is blocked the kernel can schedule another
thread of the same process.
 Kernel routines themselves can multithreaded.
Disadvantages of KLT :
 Kernel thread are generally slower to create and manage than the user
threads.
 Kernel requires Thread Control Block (TCB) for each thread in the
pool, hence complexity increases
1-13
Difference between ULT and KLT
S.N. User Level Thread Kernel Level Thread

1. ser level thread are faster to create Kernel level thread are slower to
and manage create and manage

2.  Implementation is by a thread Operating system supports creation of


library at the user level kernel level threads.

3.  ULT is generic and can run on KLT is specific to the operating system
any operating system.

4. Multi-Threaded can not take Kernel routines themselves can be


advantages of multiprocessing. multithreaded.

1-14
Difference between Process and Thread
S.N. Process Thread

1 Process is heavy weight or resource Thread is light weight, taking lesser


intensive. resources than a process.

2 Process switching needs interaction with Thread switching does not need to
operating system. interact with operating system.

3 In multiple processing environments, All threads can share same set of open
each process executes the same code files, child processes.
but has its own memory and file
resources.

4 If one process is blocked, then no other While one thread is blocked and waiting,
process can execute until the first a second thread in the same task can
process is unblocked. run.

5 Multiple processes without using threads Multiple threaded processes use fewer
use more resources. resources.

6 In multiple processes each process One thread can read, write or change
operates independently of the others. another thread's data. 1-15
Multi-Threading Models :
Some operating system provides a combined user level
thread and kernel level thread facility.
Solaris is a good example of this combined approch.
Multi-Threading models are three types.
Many-to-One Model
One-to-One Model
Many-to-Many Model 

1-16
Many-to-One Model :
Implementation of the many-to-one model (many user
level thread to one kernel level thread) allow the
application to create any number of threads that can
execute concurrently.
In this implementation, all threads activity is restricted to
user space.
Additionally only one thread can access the kernel at a
time, so only one schedulable entity is known to the os.

1-17
Many to One Model

1-18
One-to-One Model :
The one-to-one model (one user level thread to one
kernel level thread) is among the earliest
implementations of true multithreading.
In this implementation, each ULT created by the
application is known to the kernel,and all threads can
access the kernel at the same time

1-19
One to One Model

1-20
Many-to-Many Model :
The many-to-many model (many user level thread to
many kernel level thread) avoids many of the
limitations of the one-to-one model, while extending
multithreading capabilities even further.
The many- to-many model also called two-level
model, minimize programing effort while reducing the
cost and weight of each thread. 

1-21
Many to Many Model

1-22
Virtualization
Virtualization is the creation of a virtual -- rather than
actual -- version of something, such as an operating system
(OS), a server, a storage device or network resources.
Virtualization uses software that simulates hardware
functionality to create a virtual system. This practice allows
IT organizations to operate multiple operating systems,
more than one virtual system and various applications on a
single server. The benefits of virtualization include greater
efficiencies and economies of scale.
OS virtualization is the use of software to allow a piece of
hardware to run multiple operating system images at the
same time. Allowing administrators to avoid wasting
expensive processing power.

1-23
1-24
Advantages of Virtualization
1. It is cheaper.
2. It keeps costs predictable.
3. It reduces the workload.
4. It offers a better uptime..
5. It allows for faster deployment of resources.
6. It promotes digital entrepreneurship.
7. It provides energy savings

1-25
Disadvantages of Virtualization
1. It can have a high cost of implementation.
2. It still has limitations.
3. It creates a security risk.
4. It creates an availability issue.
5. It creates a scalability issue.
6. It requires several links in a chain that must work
together cohesively.
7. It takes time.

1-26
Types of Virtualization
1. Desktop Virtualization
2. Application Virtualization.
3. Server Virtualization.
4. Storage Virtualization.
5. Administrative Virtualization.
6. Network Virtualization.
7. Hardware Virtualization.

1-27
Desktop virtualization
Desktop virtualization is a method of simulating a user
workstation so it can be accessed from a remotely connected
device.
Remote desktop virtualization is also a key component of
digital workspaces Virtual desktop workloads run on desktop
virtualization servers which typically execute on virtual
machines (VMs).
Benefits of Desktop Virtualization
1.Resource Utilization: 
2.Remote Workforce Enablement: 
3.Security: 

1-28
Server Virtualization
When the virtual machine software or virtual machine
manager (VMM) is directly installed on the Server
system is known as server virtualization.
Usage: Server virtualization is done because a single
physical server can be divided into multiple servers on
the demand basis and for balancing the load.

1-29
Storage Virtualization
• Storage virtualization is the process of grouping the
physical storage from multiple network storage devices
so that it looks like a single storage device.
• Storage virtualization is also implemented by using
software applications.
Usage: Storage virtualization is mainly done for back-up
and recovery purposes

1-30
Network Virtualization
Network virtualization (NV) refers to abstracting network resources that were
traditionally delivered in hardware to software. NV can combine multiple
physical networks to one virtual, software-based network, or it can divide one
physical network into separate, independent virtual networks.

This approach moves networks from static, inflexible, and inefficient to


dynamic, and optimized.

1-31
Benefits of network virtualization
Network virtualization helps in speed, agility, and security by
automating and simplifying many of the processes Here are
some of the key benefits of network virtualization:
Reduce network provisioning time from weeks to minutes
Achieve greater operational efficiency by automating manual
processes
Place and move workloads independently of physical topology
Improve network security within the data center
Network Virtualization Example
One example of network virtualization is virtual LAN (VLAN).

1-32
Iterative server
A server process may respond to incoming
The server receives the incoming connection.
The server handles the connection.
The server closes the connection.
The server returns to listening on its well-known port.
A server that operates like this is called an iterative server. When an
iterative server is handling a request, other connections to that port
are blocked. The incoming connections must be handled one after
another.

1-33
Concurrent server
The server calls fork() to split itself into two processes, a
parent and a child.
The child process handles the connection, while the parent
returns to listen on the original port.
When the child process is finished with the connection, it
terminates.
A server that operates like this is called a concurrent server.
A concurrent server is always available for incoming
connections.

1-34
Concurrent Vs. Iterative Servers
Iterative server to describe a server implementation that processes one
request at a time
Concurrent server to describe a server that handles multiple requests at
one time.
Concurrent Servers are more complex
Concurrent servers are more difficult to design and build, and the
resulting code is more complex and difficult to modify.
Iterative server implementations, which are easier to build and
understand
Concurrent server implementations, which are more difficult to design
and build, yield better performance.

1-35
A Stateless server or process is something that does
not save or reference information about previous
operations.
A Stateful server  remembers specific details of a user
like profile, preferences, and user actions. This
information is considered as the ‘Status’ of a system.

1-36
1-37
Parameters Stateful Stateless

1. State A Stateful server remember client data (state) A Stateless server keeps nostate
from one request to the next. information
2. Statefulserver is harder to code Statelessserver is straightforward
Programming to code

3.Efficiency MoreBecause clients do not have to provide Less because information needs to
full file information every time they perform be provided
an operation
4.Crash Difficult due to loss of information Can easily recover from failure.
recovery Because there is no state that
must be restored
5.Information Using a Stateful,file server, the client can send Using a stateless file server, the
transfer less data with each request client must,specify complete file
names in each request specify
location for reading or writing re-
authenticate for each request.
6.Extra Stateful servers can also offer clients extra It does not have to implement the
services services such as file locking, and remember state accounting associated with
read and write positions opening, closing, and locking of
files. 1-38
Object server
 An object server is a server tailored to support distributed objects. The
important difference between a general object server and other (more
traditional) servers is that an object server by itself does not provide a
specific service. Specific services are implemented by the objects that
reside in the server. Essentially, the server provides only the means to
invoke local objects, based on requests from remote clients. As a
consequence, it is relatively easy to change services by simply adding
and removing objects.

 An object server thus acts as a place where objects live. An object


consists of two parts: data representing its state and the code for
executing its methods.

1-39
1-40

You might also like