You are expected to do your own work on all homework assignments. (See the statement of Academic Dishonesty on the Syllabus.)
Check the Syllabus for the late assignment policy for this course.
Assignments need to be turned in via Laulima. Check the Syllabus for the late assignment policy for the course.
You should turn in a tarred archive named ics332_hw7_USERNAME.tar that contains a single top-level directory called ics332_hw7_USERNAME where USERNAME is your UH username in all lower-case letters. In that directory, you should have all the files named exactly as specified below.
Expected contents of the ics332_hw7_USERNAME directory:
Your code must compile without any warnings or errors.
For this assignment you need a Linux environment (see Assignment #0).
Before starting the assignment you should first download, compile, and run counter.c using this Makefile. It contains a C program that uses threads to increment a counter.
Read through counter.c and make sure you understand what it is doing. Add descriptive comments for each line of code. A descriptive comment should be more than one word and make sense within the context of the surrounding comments.
Multiple concurrency bugs exist in counter.c. Fix the concurrency bugs in counter.c. In your README.txt, identify all the concurrency bugs you found (refer to line numbers in the original counter.c and also include an explanation of how you fixed them. Include the line numbers of your newly added code in your README.txt file. You should also have comments for your new lines of code in the modified counter.c.
Your solution should always print the correct counter value. Converting the entire code to be sequential/single-threaded is not a valid solution.
My solution required 6 new lines of code. If you are using significantly more lines of code, you might not be doing it correctly.