CS 3733 Operating Systems, Fall 2010 Assignment 6


Due Wednesday, December 1, 2010

This assignment will be demonstrated in class on the due date. No late assignments will be accepted.

Click here for instructions.



Part 0: Setup
Make a directory called assign6 for this assignment. Download the PUP ch18 code as you did in the recitation, run convertlinux, and make and make sure everything works correctly. Try a client and server and make sure they can communicate.

Make a part1 subdirectory and copy only the parts of the chapter 18 code needed to run the serverp and client2 programs. You can tell what you need by looking at the compile lines for these in the makefile. Use a makefile to compile and run these programs and make sure they can communicate.

Part 1: The server
Copy serverp.c into myserver.c and modify it so that it is a parallel server that handles connections as follows:

The various child processes are all writing to standard output concurrently, and it is possible that the lines sent to standard output will be interleaved. Since we are only using this for debugging and interleaving should be very rare, do not worry about this problem.

Write a program to test the server. Copy client2.c into clientTester.c and modify it as follows.

Use this to test your server. Try running at least two copies of the client concurrently with the same server. Save your results for both clients and the server. Include in your results, information about whether the output is from a client or a server, which machine the output came from, and what command line parameters were used.

Part 2: the client
Please note the following change: do not have the client print the value of getValue or singlePrecision. Do not link the client with getValue.o.

Copy client2.c into myclient.c and modify it as follows:

All hosts should be sent their ranges before any other processing is done, so the the remote hosts work concurrently. If there is an error connecting to any host, print an appropriate message and exit the program.

You know of at least three ways to handle the monitoring of the multiple network file descriptors: child process, threads, select. Whichever method you choose, each line must be output atomically, so different lines do not interleave.

Test your program and make sure it works correctly. Save the output from the client and each server. Write a paragraph describing the algorithm you used for monitoring the network file descriptors and how you ensured the syncronization.

Part 3: Testing on multiple architectures
The purpose of this part of the assignment is to make sure your client and server can communicate correctly with a machine having a different architecture.

Note the following change: only run the client on Solaris. Always run the servers on Linux.

Remotely log into one of the blade machines (blade01-blade10). These are running the Solaris operating system on a SPARC processor. The SPARC processor under Solaris uses a big endian representation of integers while the Intel processors used in our Linux machines are little endian.

Modify your makefile so that typing make solaris will produce a client executable for a Solaris machine. This executable should have different names from the Linux version, but should be created from the same source files. Be sure to use the correct libraries when compiling on Solaris.

Test your programs with a Solaris client and Linux servers. Save your output as before, labeling each with the name of the machine used.

Handing in the assignment
Use this cover sheet for handing in your assignment. Answer the questions listed on the cover sheet. Come to class on Wednesday, December 1 with your printed source code and results. Do not hand in your printout at the beginning of class. Be prepared to run your server and client on either Linux or Solaris. The executables should have been created before coming to class.