Programming Languages: Project 6

Multithreaded Ticketmaster

In this assignment, you will add multi-threading capabilities to the Ticketmaster project.

Read this entire document before you start working so you can get a feel for how the classes fit together.

Getting Started

Project Overview

I've given you the solution to project 5 (Ticketmaster). If you want to, you may use your own solution, but at your own risk.

In project 5, all seating reservations were made in a single-threaded manner. That is, if someone started making a reservation or canceling one, the program would not let a second person make or cancel a reservation until the first one was processed. In this project, you will change the way this works so that seats are reserved in a multithreaded manner: every time someone wants to reserve or cancel a block of seats, a new thread is generated that will run the reservation or cancellation code. The reason for this is so that when someone wants to reserve a block of seats that can't be accommodated, that thread will automatically block (pause) until enough seats become available.

You will implement this functionality with synchronized blocks and/or methods and by using wait() and notifyAll() to allow threads to signal each other.

Furthermore, since you will have multiple reservation/cancellation threads all running simultaneously, I have constructed a class called TheaterDisplay that shows a live seating chart of the theater. This class, however, does not automatically monitor the theater for live updates, so whenever the theater adds or loses a reservation, you should call refresh() on the TheaterDisplay object to allow the changes to be seen.

Classes to Edit

Sample Runs

Grading

Solutions should be:

Turn-in instructions