Process presentation

243 views 16 slides Sep 05, 2018
Slide 1
Slide 1 of 16
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16

About This Presentation

brief detail of pricess


Slide Content

Subject : Operating system Submitted to : mam raheela

Topic : Submitted by : Sadia khan Misbah Nazeer Section: BSIT Evening A

Process Process is a program in execution. A process is the basic unit of execution in an operating system. When a program is loaded into the memory and it becomes a process.

Process parts Program : (Code/text) A program is a piece of code which may be a single line or millions of lines. Data : This section contains the global and static variables. Heap : Contains memory dynamically allocated during run time. Stack : Temporary Data like function parameters, return addresses, local variable.

Process life cycle Processes may be in one of 5 states. New  - The process is in the stage of being created. Ready   - The process has all the resources available that it needs to run, but the CPU is not currently working on this process's instructions. Running   - The CPU is working on this process's instructions. Waiting  - The process cannot run at the moment, because it is waiting for some resource to become available or for some event to occur. For example the process may be waiting for keyboard input, inter-process messages, or a child process to finish. Terminated -  The process has completed.

Process life cycle

Process life cycle There is also a suspended stage in some cases Suspend ready - if a process is in ready state and a more priority process arrives then the previous process is sent to suspend ready state (inside the secondary memory) Suspend wait - if a process is in wait or block state and a more priority process arrives then the previous process is sent to suspend block state (inside the secondary memory) as soon  as the ready or block state is empty it is sent to ready or block state respectively. 

Process Control Block A Process Control Block is a data structure maintained by the Operating System for every process. The PCB is identified by an integer process ID (PID). A PCB keeps all the information needed to keep track of a process 

PCB Process State The current state of the process i.e., whether it is ready, running, waiting, or whatever. Process privileges This is required to allow/disallow access to system resources. Process ID Unique identification for each of the process in the operating system Program Counter Program Counter is a pointer to the address of the next instruction to be executed for this process. CPU Scheduling Information Process priority and other scheduling information which is required to schedule the process. IO status information This includes a list of I/O devices allocated to the process.

Parent and Child Process Process creation Parent : Creating process Child : New process(created by parent) Parent process create children processes which in turn create other processes forming a three of processes. Generally, process identifier and managed via a PID. ( A child process is a replica of the parent process and shares some or all of its resources)

Process creation Resource sharing Parent and children share all resources. Children share subset of parent's resources. Parent and child share no resources. Execution Parent and children execute concurrently. Parent waits until children terminate.

Tree of P rocesses

Process termination Process executes last statement and ask the operating system to delete it(exit). Output data from child to parent. Process resources are de allocated by OS. Parent may terminate execution of child processes. Child has exceeded allocated resources. Task assigned to child is no longer required. Some OS don't allow child to continue it its parent terminates it's called cascading termination .

Inter-process communication We may divide the process as dependent or independent processes: Independent Processes   that can neither affect other processes or be affected by other processes. Cooperating Processes   or dependent process are those that can affect or be affected by other processes.

Why cooperating processes are allowed? Reasons why cooperating processes are allowed are: Information Sharing - There may be several processes which need access to the same file Modularity - The most efficient architecture may be to break a system down into cooperating modules. ( E.g. databases with a client-server architecture. ) Convenience - Even a single user may be multi-tasking, such as editing, compiling, printing, and running the same code in different windows.

Thank you