SlideShare a Scribd company logo
13
Most read
14
Most read
15
Most read
Operations on
Processes and
Cooperating
Processes
-Vishnu Vijay Menon, S3 BCA
Operations On Processes
Processes- as we know is an activity/ program under execution.
Execution of a process is a complex activity.
In modern day systems, processes are executed concurrently.
Therefore, it is the duty of an operating system to provide a flexible
mechanism for dynamically creating, maintaining anddeleting processes
in a computer system.
Operations performed while executing a process
Creation
Process Creation
Process creation is deemed to be the first step of any process execution
activity. In simpler terms, it can be put as the construction of new processes
for execution.
There are four events that leads to the creation of a “new” process:-
1. System Initialisation.
2. Execution of a process creation system call by a running process.
3. User request to create a new process.
4. Initialization of a batch job.
-A new process is created using the system call “fork()”
system call on UNIX systems [ CreateProcess() on
Windows-based systems}. The one which initiates this
call is termed as “Parent Process”; the one derived from
it is termed as “Child Process”.
-After the creation of a new process, the OS assigns a new
Process identifier , an integer value to identify a process,
which creates a new entry on the primary table.
- Then, the required memory for all elements of a process
such as program,data etc is allocated on Process Control
Block. A thing to note is that depending the
implementation of a system, some resources/data may
be shared between a child and it’s parent process. In the
beginning, not much is allocated to a process because a
user has to request to do so but it’s child may inherit
some resource from its parent.
Diagram of Creating a process using fork()
Parent
Process
After a child process is created, there are two options
for the parent process:
● Wait for the child process to terminate before
proceeding. The parent makes a wait() call. This
is more common with UNIX based systems.
● Run concurrently with the child. A scenario where
a parent process executes for a while and then
pauses, for the child process to execute, is also
possible
Process Termination
All created processes have to be terminated at some point of their cycle.
This is when a process is no longer needed for the program or some kind
of problems may have been encountered by the program.
A Process begins its termination when the final piece of the statement in
a program is executed.
Types of Process Termination
Normal Termination:- It is a type of voluntary termination, where the process
quits after it has executed the final statement. The process may return a status
value ( typically an integer) to the parent. The shared resources are also de-
allocated by the OS.
Abnormal Termination:- This type of termination occurs mostly due to
programming errors,runtime errors, user intervention etc. There are three
categories under this type of termination.
1. Error Exit: A voluntary type termination which occurs due to program bugs(
like trying to execute an illegal statement, referencing non existing memory
etc.) In some cases in UNIX systems, the process requests the OS itself to
rectify its own mistake, therefore only interrupting instead of terminating
them.
2. Fatal Errors: It is an involuntary execution, in
which there are problems in the code or a non
existent file.
3. Killed by another process:- The Process may
be terminated under the instruction of another
process. This is invoked by an appropriate
system call
A Parent may also terminate its Child when:-
1. The task given to the Child is not needed anymore.
2. The Child exceeds the usage of resources allocated
to it.
3. The Parent is exiting, resulting in the termination of
the Child.
Note: If the child is unable to be terminated since
their Parent isn’t waiting, they will be returned to init and
eventually be killed off.
Cooperating Processes
There are many Processes which may be independent or cooperates with other
processes in a program. As the name suggests, Independent Processes do not
share any data and is not affected by any other process in any way. On the
other hand, Cooperating processes may be affected by the other process in the
system.
A cooperating process is one that can affect or be affected by other process
executing in the system cooperating process can:
1. Directly share a logical address data space (i.e. code & data) - This
may result in data inconsistency. It is implemented on threads.
2. Share data only through files/ messages - It only deals with orderly
execution of cooperating process so that data consistency is maintained.
Reasons that allow Process Cooperation
1. Information Sharing: There may arise a scenario where every user wants the
same piece of information. Thus, it allows concurrent access to all the data
for everyone.
2. Computation Speedup: A Process is expected to execute efficiently. So we
breakup these processes into smaller sub tasks, where they will be
parallely executing with one another.
3. Modularity: Modular systems refers to a system that divides its functions
into separate processes.
4. Convenience: It enables the user to perform some tasks and run some
programs at the same time.
Methods of Cooperation
There are two ways:
a) Cooperation by Sharing:- Processes can cooperate with each other by
sharing data,memory,files,databases.
Here, P1 and P2 share memory,variables,files,databases etc.
b) Cooperation by communication:- This method is
generally tricky to execute. The processes in this
method communicate through passage of messages.
It may lead to a deadlock, if each process is waiting
for a message. If it never receives, it may lead to
starvation.
In the diagram given, the processes
communicate through messages.
Thank You !!

More Related Content

PPTX
Demand paging
Trinity Dwarka
 
PPTX
Critical section problem in operating system.
MOHIT DADU
 
PPT
Memory Management in OS
vampugani
 
PPTX
Disk Scheduling Algorithm in Operating System
Meghaj Mallick
 
PPT
Chapter 10 - File System Interface
Wayne Jones Jnr
 
PDF
Cs8493 unit 2
Kathirvel Ayyaswamy
 
PDF
Deadlock Avoidance - OS
MsAnita2
 
Demand paging
Trinity Dwarka
 
Critical section problem in operating system.
MOHIT DADU
 
Memory Management in OS
vampugani
 
Disk Scheduling Algorithm in Operating System
Meghaj Mallick
 
Chapter 10 - File System Interface
Wayne Jones Jnr
 
Cs8493 unit 2
Kathirvel Ayyaswamy
 
Deadlock Avoidance - OS
MsAnita2
 

What's hot (20)

PPTX
Desktop and multiprocessor systems
V.V.Vanniaperumal College for Women
 
PPT
Communications is distributed systems
SHATHAN
 
PDF
OS - Process Concepts
Mukesh Chinta
 
PPTX
Dynamic interconnection networks
Prasenjit Dey
 
PDF
Unit II - 3 - Operating System - Process Synchronization
cscarcas
 
PPTX
Inter Process Communication
Adeel Rasheed
 
PPT
17. Recovery System in DBMS
koolkampus
 
PDF
CS9222 ADVANCED OPERATING SYSTEMS
Kathirvel Ayyaswamy
 
PDF
Parallel and Distributed Computing chapter 3
AbdullahMunir32
 
PDF
Database recovery techniques
pusp220
 
PPT
Mutual exclusion and sync
Dr. C.V. Suresh Babu
 
PPTX
Evolution of os
janani thirupathi
 
PPT
process creation OS
Kiran Kumar Thota
 
PPTX
System components (os)
snegacmr
 
PPTX
Operating system architecture
Sabin dumre
 
PPSX
Election algorithms
Ankush Kumar
 
PDF
Feng’s classification
Narayan Kandel
 
PPT
Memory management
Vishal Singh
 
PPTX
Memory Management in OS
Kumar Pritam
 
PPTX
Kernel I/O subsystem
AtiKa Bhatti
 
Desktop and multiprocessor systems
V.V.Vanniaperumal College for Women
 
Communications is distributed systems
SHATHAN
 
OS - Process Concepts
Mukesh Chinta
 
Dynamic interconnection networks
Prasenjit Dey
 
Unit II - 3 - Operating System - Process Synchronization
cscarcas
 
Inter Process Communication
Adeel Rasheed
 
17. Recovery System in DBMS
koolkampus
 
CS9222 ADVANCED OPERATING SYSTEMS
Kathirvel Ayyaswamy
 
Parallel and Distributed Computing chapter 3
AbdullahMunir32
 
Database recovery techniques
pusp220
 
Mutual exclusion and sync
Dr. C.V. Suresh Babu
 
Evolution of os
janani thirupathi
 
process creation OS
Kiran Kumar Thota
 
System components (os)
snegacmr
 
Operating system architecture
Sabin dumre
 
Election algorithms
Ankush Kumar
 
Feng’s classification
Narayan Kandel
 
Memory management
Vishal Singh
 
Memory Management in OS
Kumar Pritam
 
Kernel I/O subsystem
AtiKa Bhatti
 
Ad

Similar to Operations on Processes and Cooperating processes (20)

PPT
9 cm402.13
myrajendra
 
PPTX
unit 2- process management of Operating System
leyaji3927
 
PPTX
operating system process management with example
salihan090918
 
PPTX
OS - Chapter # 3 for the development of os
TahaShahid18
 
PPTX
Lecture 2 process
Kumbirai Junior Muzavazi
 
PDF
Operating System Lecture 4 on Different Topics
ZakriyaMalik2
 
PDF
Lecture_3-Process Management.pdf
Harika Pudugosula
 
PPTX
Process and thread Management Operating system
ankitashah871482
 
PPT
Lect3 process
santosh rao
 
PPTX
Process presentation
Urwa Shanza
 
PPTX
operating system module 2 presentation notes
ksamjish
 
PPT
Ch2_Processes_and_process_management_1.ppt
Mohammad Almuiet
 
PPT
11_UNIX_Processes_Including_Select.ppt
SIDDHARTHANANDCSE202
 
PPTX
Operating system Chapter 3 Part-1 process and threads.pptx
fikadumeuedu
 
PDF
Processes in unix
miau_max
 
PDF
process.pdfzljwiyrouyaeutoaetodtusiokklhh
abhinandpk2405
 
PPTX
Chapter3_ProcessConcept-Operation_on_Processes.pptx
SaraZara10
 
PPTX
Chapter two process.pptx
MezigebuMelese1
 
PPT
Processes this has stuff about processes and deifntions.ppt
SLowe7
 
9 cm402.13
myrajendra
 
unit 2- process management of Operating System
leyaji3927
 
operating system process management with example
salihan090918
 
OS - Chapter # 3 for the development of os
TahaShahid18
 
Lecture 2 process
Kumbirai Junior Muzavazi
 
Operating System Lecture 4 on Different Topics
ZakriyaMalik2
 
Lecture_3-Process Management.pdf
Harika Pudugosula
 
Process and thread Management Operating system
ankitashah871482
 
Lect3 process
santosh rao
 
Process presentation
Urwa Shanza
 
operating system module 2 presentation notes
ksamjish
 
Ch2_Processes_and_process_management_1.ppt
Mohammad Almuiet
 
11_UNIX_Processes_Including_Select.ppt
SIDDHARTHANANDCSE202
 
Operating system Chapter 3 Part-1 process and threads.pptx
fikadumeuedu
 
Processes in unix
miau_max
 
process.pdfzljwiyrouyaeutoaetodtusiokklhh
abhinandpk2405
 
Chapter3_ProcessConcept-Operation_on_Processes.pptx
SaraZara10
 
Chapter two process.pptx
MezigebuMelese1
 
Processes this has stuff about processes and deifntions.ppt
SLowe7
 
Ad

Recently uploaded (20)

PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Software Development Methodologies in 2025
KodekX
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 

Operations on Processes and Cooperating processes

  • 2. Operations On Processes Processes- as we know is an activity/ program under execution. Execution of a process is a complex activity. In modern day systems, processes are executed concurrently. Therefore, it is the duty of an operating system to provide a flexible mechanism for dynamically creating, maintaining anddeleting processes in a computer system.
  • 3. Operations performed while executing a process Creation
  • 4. Process Creation Process creation is deemed to be the first step of any process execution activity. In simpler terms, it can be put as the construction of new processes for execution. There are four events that leads to the creation of a “new” process:- 1. System Initialisation. 2. Execution of a process creation system call by a running process. 3. User request to create a new process. 4. Initialization of a batch job.
  • 5. -A new process is created using the system call “fork()” system call on UNIX systems [ CreateProcess() on Windows-based systems}. The one which initiates this call is termed as “Parent Process”; the one derived from it is termed as “Child Process”. -After the creation of a new process, the OS assigns a new Process identifier , an integer value to identify a process, which creates a new entry on the primary table. - Then, the required memory for all elements of a process such as program,data etc is allocated on Process Control Block. A thing to note is that depending the implementation of a system, some resources/data may be shared between a child and it’s parent process. In the beginning, not much is allocated to a process because a user has to request to do so but it’s child may inherit some resource from its parent.
  • 6. Diagram of Creating a process using fork() Parent Process
  • 7. After a child process is created, there are two options for the parent process: ● Wait for the child process to terminate before proceeding. The parent makes a wait() call. This is more common with UNIX based systems. ● Run concurrently with the child. A scenario where a parent process executes for a while and then pauses, for the child process to execute, is also possible
  • 8. Process Termination All created processes have to be terminated at some point of their cycle. This is when a process is no longer needed for the program or some kind of problems may have been encountered by the program. A Process begins its termination when the final piece of the statement in a program is executed.
  • 9. Types of Process Termination Normal Termination:- It is a type of voluntary termination, where the process quits after it has executed the final statement. The process may return a status value ( typically an integer) to the parent. The shared resources are also de- allocated by the OS. Abnormal Termination:- This type of termination occurs mostly due to programming errors,runtime errors, user intervention etc. There are three categories under this type of termination. 1. Error Exit: A voluntary type termination which occurs due to program bugs( like trying to execute an illegal statement, referencing non existing memory etc.) In some cases in UNIX systems, the process requests the OS itself to rectify its own mistake, therefore only interrupting instead of terminating them.
  • 10. 2. Fatal Errors: It is an involuntary execution, in which there are problems in the code or a non existent file. 3. Killed by another process:- The Process may be terminated under the instruction of another process. This is invoked by an appropriate system call
  • 11. A Parent may also terminate its Child when:- 1. The task given to the Child is not needed anymore. 2. The Child exceeds the usage of resources allocated to it. 3. The Parent is exiting, resulting in the termination of the Child. Note: If the child is unable to be terminated since their Parent isn’t waiting, they will be returned to init and eventually be killed off.
  • 12. Cooperating Processes There are many Processes which may be independent or cooperates with other processes in a program. As the name suggests, Independent Processes do not share any data and is not affected by any other process in any way. On the other hand, Cooperating processes may be affected by the other process in the system. A cooperating process is one that can affect or be affected by other process executing in the system cooperating process can: 1. Directly share a logical address data space (i.e. code & data) - This may result in data inconsistency. It is implemented on threads. 2. Share data only through files/ messages - It only deals with orderly execution of cooperating process so that data consistency is maintained.
  • 13. Reasons that allow Process Cooperation 1. Information Sharing: There may arise a scenario where every user wants the same piece of information. Thus, it allows concurrent access to all the data for everyone. 2. Computation Speedup: A Process is expected to execute efficiently. So we breakup these processes into smaller sub tasks, where they will be parallely executing with one another. 3. Modularity: Modular systems refers to a system that divides its functions into separate processes. 4. Convenience: It enables the user to perform some tasks and run some programs at the same time.
  • 14. Methods of Cooperation There are two ways: a) Cooperation by Sharing:- Processes can cooperate with each other by sharing data,memory,files,databases. Here, P1 and P2 share memory,variables,files,databases etc.
  • 15. b) Cooperation by communication:- This method is generally tricky to execute. The processes in this method communicate through passage of messages. It may lead to a deadlock, if each process is waiting for a message. If it never receives, it may lead to starvation. In the diagram given, the processes communicate through messages.

Editor's Notes

  • #15: Critical section…...