COOPERATING PROCESSES
The concurrent processes executing in the operating system may be either independent processes or cooperating processes.
- A process id independent if it cannot affect or be affected by the other processes executing in the system
- A process is cooperating if it can affect or be affected by the other processes executing in the system
There are several reasons for providing an environment that allows process cooperation
1. 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 these types of resources
2. 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. Notice that such a speedup can be achieved only if the computer has multiple processing elements (such as CPU's or I/O channels)
3. Modularity - We may want to construct the system in a modular fashion, dividing the system function into processes.
4. Convenience - Even an individual user may have many tasks to work on at one time.� For instance, a user may be editing, printing, and compiling in parallel.
- A producer process produces information that is consumed by a consumer process.
- To allow producer and consumer processes to run concurrently we must have available a buffer of items that can be filled by the producer and emptied by the consumer
- The unbound-buffer producer-consumer problem places no practical limit on the size of the buffer.
- The bound-buffer producer-consumer problem assumes that there is a fixed buffer size

0 comments:
Post a Comment