Open In App

Cooperating Process in Operating System

Last Updated : 01 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Pre-requisites: Process Synchronization

In an operating system, everything is around the process. How the process goes through several different states. So in this article, we are going to discuss one type of process called as Cooperating Process. In the operating system there are two types of processes:

  • Independent Process: Independent Processes are those processes whose task is not dependent on any other processes.
  • Cooperating Process: Cooperating Processes are those processes that depend on other processes or processes. They work together to achieve a common task in an operating system. These processes interact with each other by sharing the resources such as CPU, memory, and I/O devices to complete the task.
Cooperating Process in Operating System

 

So now let’s discuss the concept of cooperating processes and how they are used in operating systems.

  • Inter-Process Communication (IPC): Cooperating processes interact with each other via Inter-Process Communication (IPC). As they are interacting to each other and sharing some resources with another so running task get the synchronization and possibilities of deadlock decreases. To implement the IPC there are many options such as pipes, message queues, semaphores, and shared memory.
  • Concurrent execution: These cooperating processes executes simultaneously which can be done by operating system scheduler which helps to select the process from ready queue to go to the running state. Because of concurrent execution of several processes the completion time decreases.
  • Resource sharing: In order to do the work, cooperating processes cooperate by sharing resources including CPU, memory, and I/O hardware. If several processes are sharing resources as if they have their turn, synchronization increases as well as the response time of process increase.
  • Deadlocks: As cooperating processes shares their resources, there might be a deadlock condition. Deadlock means if p1 process holds the resource A and wait for B and p2 process hold the B and wait for A. In this condition deadlock occur in cooperating process. To avoid deadlocks, operating systems typically use algorithms such as the Banker’s algorithm to manage and allocate resources to processes.
  • Process scheduling: Cooperating processes runs simultaneously but after context switch, which process should be next on CPU to executes, this is done by the scheduler. Scheduler do it by using several scheduling algorithms such as Round-Robin, FCFS, SJF, Priority etc.

In conclusion, cooperating processes are essential unit to increase the concurrent execution and because of it, the performance of the overall system increases.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads