Explain the methods of implementing interacting processes, Computer Engineering

Assignment Help:

Explain any two methods of implementing interacting processes.

Two methods of implementing interacting process are given below:

(i) Shared memory solution: In this scheme requires that such processes share a common buffer pool and the code for implementing the buffer is written through the application programmer.

For illustration, a shared-memory solution can be given to the bounded- buffer problem. The producer and consumer processes share the subsequent variables:

#define BUFFER_SIZE 10

Typedef struct{

..........

 }item;

Item buffer[BUFFER_SIZE];

int in=0;

int out=0;

The shared buffer is implemented like a circular array along with two logical pointers: in/out. The variable in-points to the next free position into the buffer, out-points to the first full position into the buffer. The buffer is empty while in==out; the buffer is full while (( in + 1)%BUFFER_SIZE)==out.

The producer process has a local variable nextProduced wherein the new item to be produced is stored:

while(1){

/* produce and item in nextProduced */ While(((in + 1)%BUFFER_SIZE)==out)

; // don't do anything

Buffer[in]=nextProduced;

in =(in+1)% BUFFER_SIZE;}

The consumer process has a local variable nextConsumed in which the item to be consumed is stored:

while(1){

while(in==out)

; // don't do anything

nextConsumed = buffer[out];

out=(out +1)% BUFFER_SIZE;

/* consume the item in nextConsumed */}

(ii) Inter process Communication: The OS gives the means for cooperating processes to communicate with each other through an inter-process communication (IPC) facility. IPC gives a mechanism to allow processes to communicate and to synchronize their actions without sharing similar address space. IPC is particularly helpful in a distributed environment where the communicating processes may reside on various computers connected with a network. IPC is best implemented through message passing system where communication among the user processes is accomplished by the passing of messages. An

Inter-process communication facility gives at least the two operations: send(message) and receive(message).


Related Discussions:- Explain the methods of implementing interacting processes

Explain about indexed addressing scheme, In this technique, operand field o...

In this technique, operand field of instruction includes an address and an index register thatcomprises an offset. This addressing scheme is normally used to address the consecutiv

Operating system, define request edge and assignment edge

define request edge and assignment edge

Illustrate master-slave flip-flop, Q. Illustrate Master-Slave Flip-Flop? ...

Q. Illustrate Master-Slave Flip-Flop? Master slave flip-flop comprise two flip-flops. One is master flip-flop and other one is known as slave flip-flop. Fig below shows impleme

What is artificial intelligence neural networks, For the sake of trying to ...

For the sake of trying to make intelligent behavior though really all that's being done is work with artificial neural networks where every cell is a very easy processor and the go

Execution-modes of a multiprocessor, Q. Explain Execution-modes of a multip...

Q. Explain Execution-modes of a multiprocessor? Execution-modes of a multiprocessor: Several modes of multiprocessing comprise parallel execution of programs at (i) Fine Grain

Software engineering, how many errors will be left after defect amplificat...

how many errors will be left after defect amplification and removal method on the following data design=40 analysis=30 maintenance=20 testing 35 coding 25 take 75% removal efficie

Components of flash, A piece of art can be looked at as having 3 main compo...

A piece of art can be looked at as having 3 main components, the subject, the composition and the content. Subject The subject of an artwork is, in simple terms, the object

Basic characteristics of an experts system, An experts systems must perform...

An experts systems must perform well that is achieve the same levels of performance in the domain of interest that human experts can achieve. But simply producing good so

Illustrate memory read operation, Q. Illustrate Memory Read operation? ...

Q. Illustrate Memory Read operation? Memory unit receives the address from a register known as the memory address register designated by MAR. Data is transferred to another re

Evolutionary approaches boil down - artificial intelligence, Evolutionary a...

Evolutionary approaches boil down - artificial intelligence: In fact as we will see whether evolutionary approaches boil down to like (i) just to identify how to represent pos

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd