Question

In: Computer Science

Describe a message-transfer protocol for buffered sends and receives in which the buffering is performed only...

Describe a message-transfer protocol for buffered sends and receives in which the
buffering is performed only by the sending process. What kind of additional hardware
support is needed to make these types of protocols practical?

Solutions

Expert Solution

Principles of Message-Passing Programming:--

  1. The logical view of a machine supporting the message-passing paradigm consists of p processes, each with its own exclusive address space.
  2. Each data element must belong to one of the partitions of the space; hence, data must be explicitly partitioned and placed.
  3. All interactions (read-only or read/write) require cooperation of two processes – the process that has the data and the process that wants to access the data.
  4. These two constraints, while onerous, make underlying costs very explicit to the programmer.

Principles of Message-Passing Programming:--

  1. Message-passing programs are often written using the asynchronous or loosely synchronous paradigms.
  2. In the asynchronous paradigm, all concurrent tasks execute asynchronously.
  3. In the loosely synchronous model, tasks or subsets of tasks synchronize to perform interactions. Between these interactions, tasks execute completely asynchronously.
  4. Most message-passing programs are written using the single program multiple data (SPMD) model.

The Building Blocks: Send and Receive Operations:--

  1. The prototypes of these operations are as follows: send(void *sendbuf, int nelems, int dest) receive(void *recvbuf, int nelems, int source)
  2. Consider the following code segments: P0 P1 a = 100; receive(&a, 1, 0) send(&a, 1, 1); printf("%d\n", a); a = 0;
  3. The semantics of the send operation require that the value received by process P1 must be 100 as opposed to 0.
  4. This motivates the design of the send and receive protocols.

Buffered Blocking Message Passing Operations:-

Bounded buffer sizes can have significant impact on performance

P0

for (i = 0; i < 1000; i++)

{ produce_data(&a);

send(&a, 1, 1);

}

P1

{ for (i = 0; i < 1000; i++)

receive(&a, 1, 0);

consume_data(&a);

}

What if consumer was much slower than producer?


Related Solutions

What is the error message that occurs when the manager sends Set_Request to a read-only object?...
What is the error message that occurs when the manager sends Set_Request to a read-only object? Also, list out any three error messages in SNMP v1.
What is the error message that occurs when the manager sends Set_Request to a read-only object?...
What is the error message that occurs when the manager sends Set_Request to a read-only object? Also, list out any three error messages in SNMP v1.
1. Describe in detail the two ways in which a hormone can deliver its message to...
1. Describe in detail the two ways in which a hormone can deliver its message to a target cell. What characteristics of the hormone determine which mechanism is used? 2. List and briefly describe the chemical sequence of events in the fight-or-flight response to a threatening situation from the binding of epinephrine at the receptor site to readiness for another situation. 3. Compare the nervous system and the endocrine system with respect to chemical messengers used, and the messenger molecules'...
1 Describe the process by which the financial markets would operate to transfer the funds from...
1 Describe the process by which the financial markets would operate to transfer the funds from savers to the borrower (the student). 2 What is meant by a financial intermediary? Is there a financial intermediary in this case? If so, who/what is the intermediary?
Which transfer pricing method works with (a) service contracts, (b) distribution/sales, and (c) manufacturing? Describe how...
Which transfer pricing method works with (a) service contracts, (b) distribution/sales, and (c) manufacturing? Describe how the specific method is applied in each case.
Describe the different types of unemployment. Which type only exists when the economy is in a...
Describe the different types of unemployment. Which type only exists when the economy is in a recession? Which types are likely to persist even when the economy is doing well? Why do critics say the official unemployment rate understates the true level of unemployment?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT