There are two types of processes:-
1. Independent process-
These processes work independentaly of them-selves. They do not affect and can not be affected by other processes that are running with in the operating system. These process does not share any data with any process or systems.
2. Co-operating 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.
Methods of co-operation:-
Co-operating processes can coordinate with each other using shared data or messages.
Details about given as follows:-
1. Co-operation 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:
-> Process P1 and P2 can cooperate with each other using shared data such as memory, variables, files, databases etc.
2. Co-operation 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:
-> Process P1 and P2 can cooperate with each other using messages to communicate.