Cooperating Processes is explained as follows
The concurrent processes executing in the operating system can be either independent processes or the cooperating processes. A process is self-governing or independent if it cannot affect or be affected by any other process executing in system. Clearly any process which shares data with other processes is a cooperating process. The advantages of cooperating processes are given below:
1) Information sharing Since several users may be interested in the same piece of the information (such as we can say a shared file) we should provide an environment to allow concurrent users to access these types of resources.
2) Computation speedup If we want a particular task to run quicker, we should break it into the subtasks each of which will be running in parallel with the others. Such a speedup can be obtained only if the computer has multiple processing elements (such as CPU's or I/O channels).
3) Modularity We might require to construct the system in the modular fashion, dividing the system functions into the separate processes or threads.
4) Convenience Even an individual user may have many tasks on which to work at one time. For example, a user may be printing, editing, and compiling in parallel. To demonstrate the concept of communicating processes, let us take the producer- consumer problem. A producer process produces the information which is consumed by a consumer process. For instance, a compiler may create assembly code which is consumed by an assembler. To permit a producer and consumer to run concurrently, we must available the buffer of items that can be filled by a producer and emptied by a consumer. The producer and consumer must be synchronized so that the consumer does not try to consume an item which has not yet been produced. The bounded buffer problem suppose a fixed buffer size, and the consumer should wait if the buffer is empty and the producer should wait if the buffer is full, whereas the unbounded buffer places no practical limit on size of the buffer. Figure shows the problem in a diagram. This buffer may be given by the interprocess communication or with the use of the shared memory.
Figure of The producer-consumer problem
Figure shows the shared buffer and the other variables used by producer and consumer processes.
Figure shows the Shared buffer and variables used by the producer and consumer processes
The shared buffer is implemented as the circular array with the two logical pointers: in and out. The 'in' variable points to the next free position in buffer; 'out' points to the first full position in the buffer. The buffer is empty or vacant when in is equal to out (that is in==out), the buffer is full when ((in+1)%BUFFER_SIZE)==out. The code structures for the producer and consumer processes are shown in Figure drawn below
Figure gives the Code structures for the producer and consumer processes
Email based Operating System assignment help - homework help at Expertsmind
Are you searching Operating System expert for help with Cooperating Processes questions? Cooperating Processes topic is not easier to learn without external help? We at www.expertsmind.com offer finest service of operating system assignment help and operating system homework help. Live experts are available for 24x7 hours helping students in their Cooperating Processes related problems. We provide step by step Cooperating Processes question's answers with 100% plagiarism free content. We prepare quality content and notes for Cooperating Processes topic under operating system theory and study material. These are avail for subscribed users and they can get advantages anytime.
Why Expertsmind for assignment help
- Higher degree holder and experienced tutors network
- Punctuality and responsibility of work
- Quality solution with 100% plagiarism free answers
- Time on Delivery
- Privacy of information and details
- Excellence in solving operating system questions in excels and word format.
- Best tutoring assistance 24x7 hours