nicname-proto.multithread Documentation

version date 2004-01-10. All previous versions are hereby made obsolete.
abstract This is the documentation for nicname-proto.multithread. It is a prototype to explore multipeer server architecture with RPC and additionally RPC servers in separate threads. You may use it as an example how to create similar applications. nicname-proto does not belong to ECO32 simulator but is a stand-alone artefact. It led lateron to the development of nicname. nicname is the simulation of an ethernet LAN for ECO32. ECO32 is a instruction set simulation for a processor of that same name. nicname-proto.multithread and nicname were developed as a student's project in course "Mikroprozessortechnik II" (microprocessor technology II) at the University of Applied Sciences Giessen-Friedberg (Germany) in winter term 2003/2004. The course was led by Prof. Dr. Hellwig Geisse.
license public domain. This applies to this documentation and to all source code of nicname and nicname-proto, but says nothing about the licenses of the rest of ECO32.
authors Mathias Schäfer
Matthias Ansorg
table of contents

Architecture

nicname-proto is made of several programs which communicate via RPC. One of these program is of type "ViNet" (virtual network), the others of type "IfProxy" (interface proxy).

All IfProxy processes use the ViNet process as RPC server. The ViNet process uses all IfProxy processes as RPC servers.

Processes of type IfProxy implement the server functionality in a separate thread.

All RPC servers are iterative, not cocurrent.

Usage

Start ViNet process; nothing happens. Start multiple IfProxy processes, thereby giving the hostname for ViNet process and a message as parameters. When starting an IfProxy process, the ViNet process prints out the delivered message and makes all running IfProxy processes to print that same message, including the sending IfProxy process.

What happens internally

  1. ViNet is running as a rpc server.
  2. The new IfProxy process makes itself known as an rpc server towards ViNet. To that means, it calls a rpc function provided by ViNet. Parameters are the local hostname and the rpc program number where to contact this IfProxy rpc server. This program number is non-ambiguous because it is made of a base number and the own process id.
  3. The ViNet process handles such a registration by storing hostname and rpc program number in a dynamically managed list.
  4. The new IfProxy calls ViNet via rpc to send its message. This call is initiated from the IfProxy main process, not the rpc server thread.
  5. The ViNet process handles this call by printing the message, calling all registered IfProxy rpc servers to print this message, and then returning. This way, the multithread functionality is tested, because the main process of IfProxy is blocked with sending a message, while the server thread serves by printing a message.