Sie sind auf Seite 1von 16

Amity School of Engineering & Technology

MODULE-II
Process Management

Amity School of Engineering & Technology

Process Concept

An operating system executes a variety of


programs:
Batch system jobs
Time-shared systems user programs or tasks

Textbook uses the terms job and process almost


interchangeably.
Process a program in execution; process
execution must progress in sequential fashion.
2

Amity School of Engineering & Technology

The components of process are as followa. The object program to be executed.


b. The data on which the program will execute.
c. Resources require by the program.
d. The status of processs execution (PC).

Amity School of Engineering & Technology

...
...

Amity School of Engineering & Technology

As a process executes, it changes state


new: The process is being created.
running: Instructions are being executed.
waiting: The process is waiting for some
event to occur.
ready: The process is waiting to be
assigned to a process.
terminated: The process has finished
execution.
5

Amity School of Engineering & Technology

Process Control Block(PCB)

Amity School of Engineering & Technology

Information associated with each process.


Process state- new, ready, running, waiting.
Program counter CPU registers CPU scheduling information Memory-management information
Accounting information
I/O status information
7

Amity School of Engineering & Technology

THREADS

1. In computer science, a thread of execution is


the smallest unit of processing that can be
scheduled by an OS.
2. Threads represent a software approach to
improving performance of OS by reducing the
overhead of process switching. A thread has
come of the characteristics of a process, but it is
possible to have several threads sharing the
same memory space.
8

Amity School of Engineering & Technology

3. A thread some times called a light weight


process (LWP) with a reduced state.
4. A thread is a basic unit of CPU utilization.

Amity School of Engineering & Technology

CPU switch from process to process


10

Amity School of Engineering & Technology

Single and Multithreaded Processes

11

Amity School of Engineering & Technology

A thread is a path of execution through a


program. Single threaded programs have one
path of execution, and multi-threaded programs
have two or more paths of execution. Single
threaded programs can perform only one task at
a time, and have to finish each task in sequence
before they can start another. For most
programs, one thread of execution is all you
need, but sometimes it makes sense to use
multiple threads in a program to accomplish
multiple simultaneous tasks.
12

Amity School of Engineering & Technology

Benefits of Multithreading
It takes far less time to create a new process in an
existing process than to create a brand-new process.
It takes less time to terminate a thread.
It takes less time to do control switching between two
threads within a same process than process switching.
Threads make it easier to communicate between
different execution traces. Sharing the same user
address space enables the communication naturally but
process communication demands special supports from
the operating system.
13

Amity School of Engineering & Technology

Inter Process Communication (IPC)


Processes executing concurrently in the OS
may be either independent process or
cooperating processes.
1. A process is independent if it cannot
affect does not share data with any other
process is independent.
2. A process is cooperating if it can affect or
be affected by the other processes executing
in the system.
14

Amity School of Engineering & Technology

Features
1. Information Sharing
2. Computation speedup

3. Modularity
4. Convenience

15

Amity School of Engineering & Technology

Thank you
Also Read The Numerical Of CPU Scheduling

Das könnte Ihnen auch gefallen