Process Part 3: Operating System
Process Part 3: Operating System
Process Part 3: Operating System
O P E R AT I N G S Y S T E M
INDEPENDENT PROCESS VS
COOPERATING PROCESS
• A process is independent if it cannot affect or be affected by the other processes executing in the
system. Any process that does not share data with any other process is independent.
• A process is cooperating if it can affect or be affected by the other processes executing in the
system. Any process that shares data with other processes is a cooperating process.
• Operating system needs to provide an environment that allows process cooperation for:
– Information sharing. Since several users may be interested in the same piece of information (for instance, a
shared file), we must provide an environment to allow concurrent access to such information.
– Computation speedup. If we want a particular task to run faster, we must break it into subtasks, each of
which will be executing in parallel with the others.
– Modularity .We may want to construct the system in a modular fashion, dividing the system functions into
separate processes or threads
– Convenience. Even an individual user may work on many tasks at the same time. For instance, a user may
be editing, listening to music, and compiling in parallel.
INTERPROCESS COMMUNICATION
MECHANISM
• Cooperating processes require an interprocess communication (IPC) mechanism that will
allow them to exchange data and information.
• There are two fundamental models of interprocess communication: shared memory and
message passing.
MESSAGE PASSING VS SHARED
MEMORY
• In the shared-memory model, a region of memory that is shared by cooperating processes is
established. Processes can then exchange information by reading and writing data to the shared
region.
• In the message-passing model, communication takes place by means of messages exchanged
between the cooperating processes.
SHARED MEMORY SYSTEM