[an error occurred while processing this directive]

Programming Assignment 2 - Step 2


Modifying the Queue Test

The QueueTest class is set up so that you can easily run the test with multiple processes accessing the test queue. The file QueueTest.java contains a comment that says "Uncomment the following line for Step 2.". Just remove the double slash from the following line.

Now recompile the QueueTest class and run it again. You should see several reports involving "Getter 2". You should also see some strange things happening in the test log. The "gets" reports should show that some of the queue items have been gotten twice and some were never gotten. If you don't see this kind of behavior, try running the test again. There is a random element in the process scheduling and on rare occasions everything will work correctly. If you still don't see the erratic behavior, you probably forgot to recompile. That is almost certainly true if you don't see any mention of "Getter2".

Take a careful look at the test log. Try to understand why the erratic behavior occurs. Your lab report should include a paragraph or two with an explanation of reason for the erratic behavior. [an error occurred while processing this directive]