COSC441 Assignment 2, 2017
The purpose of this assignment is to get you to write
a concurrent program which does something not entirely
trivial for which concurrency is appropriate. This is
simplified from what I described in lecture 4.
The situation is an "Auction" service.
I have capitalised Service, Client, and Auction, because
each of these things should correspond to an independent thread.
Your task has three parts:
- Spell out in more detail what the threads know
and what exactly is to be communicated between them (5%).
I hate to say this, but UML class and sequence diagrams
might be useful.
- Choose a mechanism for these threads to communicate with
each other and say why that's a good way. (You may assume
that all these activities are happening within a single
UNIX process.) (5%).
As one example, as described above, the Service can tell
which Clients might be interested in an Auction,
but only an Auction knows for sure. Is it better for
“still interested” information to be held by
Auctions, or would a global data structure be better? Why?
- Write a program (C or Java preferred, though Ada would be
lovely) to make this work. You can generate Auctions
using random numbers; your Clients can also make decisions
based on random numbers. (5%)