HINTS ON HOW TO DESIGN THE PROTOCOL

Imagine that copying the packet in and out of the buffer could take a very long time because messages can be very large.

You must therefore design the protocol so that no thread ever has to wait unnecessarily for another thread to finish copying a packet in or out of a buffer.

On the other hand, assume it takes an insignificant amount of time to check to see if some status flag is true or false or to change the value of a status flag. Therefore it is not a problem if your protocol forces threads to wait for each other to finish checking or changing status flag(s).

IMPORTANT CONCEPTS THAT COULD BE REGULATED BY FLAGS OR WITH SEMAPHORES:

SIMILARITIES WITH OTHER PROBLEMS:

There is a relation here to the Hi Ho problem. First the user thread copies a packet into a buffer, and then the agent copies a packet out of the buffer.

There is similarity here to the producer-consumer problem. A user is similar to a producer and an agent is similar to a consumer.

STRAGTEGIES FOR WORKING UP TO A SOLUTION TO THE PROBLEM:

Solving some simplified problems may give you insights that help you to see a solution to the problem assigned. Here are some simplified variations on the problem: