University of Helsinki
Department of Computer Science
Rinnakkaisohjelmistot Autumn 2004, Exercises 6 (8.12.2004)
Suomeksi


Area to be studied: Andrews: 7.1-7.5 Message Passing, 8 RPC and Rendezvous, 10.3 RPC and Rendezvous.
Stallings: 13.2 Distributed Message Passing, luku 13.3 Remote Procedure Calls.

These exercises handle message passing and remote procedure calls in distributed environment.


o 1 - DATABASE SERVER

Consider the readers/writers problem. Design such a solution to the problem where the database used is situated on a separate server and only server processes are allowed to access the database. The readers and writers interact with server using asynchronous message passing.

Show the needed message interfaces (channels) for the readers and writers to use and give the code for the server processes.

Hint: Use the monitor given in Fig 5.5 to implement the mutual exclusion needed (one writer in a time, multiple readers in a time).

o 2 - LOAD INFORMATION

An distributed application consists of a chain of nodes (S[0]-S[1]- ...-S[N-1]), each of which is located on a different network workstation (each node can communicate with its neighbors only). The network system also has a load balancing application LB. Each node contains an LB component, which

1) receives from the local system messages containing information about changes in the local workload and forwards these to its neighbors
2) forwards the corresponding messages received from one neighbor to the other one
3) replies to workload inquiries made by the maintenance staff.

LB uses message passing in all communication (with the local system, with its neighbors and with the maintenance people). Write the communication parts of the LB code.

Hint: There are three different events to be handled. Write a separate process with a private channel for each event, or use a common channel with dedicated operation codes.

o 3 - MULTICASTING AND PROXY

The implementation of a multicast operation over a slow link can be improved: the message is first transmitted to a proxy server located in the fast network and the proxy sends the message (one by one) to all intended recipients.

                     --> receiver[i]
sender[x] ---> proxy --> receiver[j]
                     --> reveiver[k]

Write the algorithm of the proxy. Communication is based on message passing through send/receive operations, and the addresses are channel (the intended recipient "i" receives the message from the channel inbox[i]; the "names" of the possible recipients are 0,1,2,...,N-1 ).

You need not to fix how the connections are established or how the processes and channels are bind.

o 4 - REMOTE PROCEDURE CALL

Explain the key ideas of the remote procedure call. What must be done on the client side and what on the server side? How does the system find out where the service is located? The implementation of the remote operation seems to be just a procedure body. Who will execute it? etc. etc.

o 5 - PIPELINE AND REMOTE PROCEDURE CALL

An application has been distributed to form a pipeline. Write the code for one node (in the middle of the pipeline). Use remote procedure calls in communication.

We have here two operations: 1) getting data from the predessor and 2) forwarding data to successor. To be able to do these concurrently, implement the input as a remote procedure operation and write another process to forward the data (to call the successors remote procedure). Since these two operations use shared buffer iside the module, you need to take care of mutual exclusion.

Remember to fill teaching evalution form for this course (http://ilmo.cs.helsinki.fi/kurssit/servlet/Valinta?kieli=en).

The knowledge is not a reward, it is the result.

Liisa Marttinen