COSC 4330--Operating Systems
Programming Assignment No. 3:  Ticket Reservations Revisited
Due Date: December 12, 2004

For this assignment, you will do a more realistic simulation of the ticket reservation system "Fall-OS" that you already simulated for the second assignment.

We will still represent each agent by a separate process whose body will consist of all the ticketing made by that agent.  These agent processes will still execute in parallel.  The main difference with the second assignment will be the way the agents will access the shared data.  Rather than directly accessing the shared data, agents will communicate with a single-threaded server that will actually perform the requests.

You will have to submit two programs

1.       A client program that will fork one process per agent.  These agent processes will send to the server process one request for each transaction described in their input data, wait for the reply from the server and print out the outcome of that transaction.

2.       A single-threaded server program that will wait for requests from agent processes and implement them.

All inputs will have exactly the same formats as in the previous assignments.  The time delays will probably be shorter and will represent sleep times to be added to the processing of each transaction.

As before, agents don't need to reserve seats before ticketing them.  They can only cancel seats for the customer who has reserved them but only until he or she has not purchased them.

Your program should print out

1.       A summary of each transaction immediately after that transaction is processed.

2.        A report showing the final seat assignments with customer names when the program terminates.

HINTS

1.       Having a single threaded server should greatly simplify its design.

  1. Look first at the file BSD Sockets: A Quick And Dirty Primer at URL
    http://www.frostbytes.com/~jimf/papers/sockets/sockets.html
    and at several other locations.

It contains a quick and dirty introduction to sockets.  You can include any code from that document in your assignment.

  1. Bayou is a dual-processor machine and each of its two processors has a different name and a different IP address.  Your program will not work correctly if the client and the server run on different processors.
  2. The input file will have to be read by both the client program and the server programs even though they will use different parts of it.
  3. Most of the reply messages returned by the server will be very short (either CONFIRM or DENY). The sole exception will be the replies to a check request.  It might be more convenient for you to parcel out this request into several messages.

These specifications were modified last on Tuesday, November 23, 2004.  Check the course web sites for cor­rections and updates.  The most recent changes will be highlighted in the same color as the timestamp of the last update.