Galaxy Communicator Documentation:

Double server example

License / Documentation home / Help and feedback

In this example, we demonstrate the basic functionality of the Communicator server architecture.

This example can be found in the distribution in contrib/MITRE/examples/double.

Source files

double_core.c: demonstrates a number of basic capabilities and important details of writing a Communicator server, including multiply.c: demonstrates the use of the INIT: keyword in the program file, as well as implementing the second server for the complex double example.

headerless_double.c: illustrates the same basic capabilities as double.c, but in addition shows how to declare server information without using the server headers.

Running the example

All configurations in this example can be accessed by invoking the process monitor, as follows.
Unix

% cd <root_of_GC>
% ./contrib/MITRE/tools/bin/process_monitor contrib/MITRE/examples/double/double.config

Windows

C:\> set GC_HOME=<root_of_GC>
C:\> python %GC_HOME%\
contrib\MITRE\tools\src\process_monitor\process_monitor.py %GC_HOME%\contrib\MITRE\examples\double\double.config
In addition, on Unix, we generate the following scripts.

double.csh: runs the double server and the Hub, using the double.pgm program file. You can play with the headerless_double server by substituting it into this script.

complex_double.csh: runs the double server, the multiply server, and the Hub, using the complex_double.pgm program file.

validating_complex_double.csh: runs the double server, the multiply server, and the Hub, using the wrong_complex_double.pgm program file. This program file contains several errors, warning for which are printed out by the Hub, which is started with the -validate flag. See the program file for details.

scriptless_complex_double.csh: runs the double server, the multiply server, and the Hub, using the scriptless_complex_double.pgm program file. This program file has no programs.

logging_complex_double.csh: runs the double server, the multiply server, and the Hub, using the logging_complex_double.pgm program file. This demo exemplifies partial scripting and logging.

client_complex_double.csh: runs the double server, the multiply server, and the Hub, using the client_complex_double.pgm program file. This demo exemplifies the listener-in-Hub capability. To run this example, start the Hub first, then the multiply server, then the double server.

continuation_double.csh: runs the double server and the Hub, using the continuation_double.pgm program file. This example demonstrates how to use continuations, and in particular how they can be used to resolve deadlocks. See the comments in the program file for details.

Language bindings

The python/ subdirectory contains Python versions of the double and multiply servers. These servers are completely interchangeable with the C versions. In order to play with them, you can substitute them into the scripts.

The acl/ subdirectory contains Allegro Common Lisp versions of the double and multiply servers. These servers are completely interchangeable with the C versions. In order to play with them, you can substitute them into the scripts.

The java/ subdirectory contains a Java version of the double and multiply servers. These servers are completely interchangeable with the C versions. In order to play with them, you can substitute them into the scripts. Note that the command line arguments for the Java version of the listener-in-Hub capability are slightly different than the other bindings.

Compilation

On Unix, typing "make" in this directory will create the servers, MIT-style Makefiles, scripts, and Python, Java and Allegro Common Lisp servers.

The C version of this server contains a MSVC workspace for Windows, which is also included in the toplevel MSVC workspace for the Galaxy Communicator distribution.

Discussion

See the documentation on adding a server.


License / Documentation home / Help and feedback
Last updated August 8, 2002