Cooperating Process


Cooperating processes are those that can affect or are affected by other processes running on the system. Cooperating processes may share data with each other.

Reasons for needing cooperating processes

There may be many reasons for the requirement of cooperating processes. Some of these are given as follows −

  • Modularity

    Modularity involves dividing complicated tasks into smaller subtasks. These subtasks can completed by different cooperating processes. This leads to faster and more efficient completion of the required tasks.

  • Information Sharing

    Sharing of information between multiple processes can be accomplished using cooperating processes. This may include access to the same files. A mechanism is required so that the processes can access the files in parallel to each other.

  • Convenience

    There are many tasks that a user needs to do such as compiling, printing, editing etc. It is convenient if these tasks can be managed by cooperating processes.

  • Computation Speedup

    Subtasks of a single task can be performed parallely using cooperating processes. This increases the computation speedup as the task can be executed faster. However, this is only possible if the system has multiple processing elements.

Methods of Cooperation

Cooperating processes can coordinate with each other using shared data or messages. Details about these are given as follows −

  • Cooperation by Sharing

    The cooperating processes can cooperate with each other using shared data such as memory, variables, files, databases etc. Critical section is used to provide data integrity and writing is mutually exclusive to prevent inconsistent data.

    A diagram that demonstrates cooperation by sharing is given as follows −

    Cooperating Processes

    In the above diagram, Process P1 and P2 can cooperate with each other using shared data such as memory, variables, files, databases etc.

  • Cooperation by Communication

    The cooperating processes can cooperate with each other using messages. This may lead to deadlock if each process is waiting for a message from the other to perform a operation. Starvation is also possible if a process never receives a message.

    A diagram that demonstrates cooperation by communication is given as follows −

    Cooperating communication in Processes

In the above diagram, Process P1 and P2 can cooperate with each other using messages to communicate.

Updated on: 24-Jun-2020

7K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements