Write a main program called wordCountThread that is like the wordCountChild of Assignment 4, but uses threads instead of child processes. Do not communicate using pipes. Use shared variables. Make sure the execution is concurrent and you report results as soon as they are available. Avoid busy waiting. You should not use sleep or one of its variants to avoid busy waiting. You should suspend the process (or thread) until an appropriate event occurs.
As part of your design you must address the following issues. Include with what you turn in answers to each of these questions. Do not write these out by hand. Type them into a file (you do not need to use a word processor) and print the file. The answers to these questions will be a major part of your grade for this assignment.
Handing in your assignment
Use this cover sheet.
Consecutively number all of
the pages you turn in. Make sure you answer the questions that are on the
cover sheet.