Pthreads
Description
Write a program that uses pthreads to perform statistical analysis on a text
file. The program must compute the normalized frequency of token occurrences
and print out the top n frequent tokens. Here we will consider a token to
be text that is separated by white space.
Specifications
The program must be properly modular and documented appropriately.
The allowable languages for this assignment are: C or C++.
The name of the compiled program must be
p5.The default make target should create both executables.
The input to the program must be in the form of command line arguments as follows:
-h(by itself with no other arguments) print the usage instructions.-t <integer>(required) the number of threads to use.-n <integer>(required) the top most frequent tokens to print.-f <string>(required) the name of the text file.
Note: if the program has global variable(s) or any kind of mutual exclusion mechanism, then you will receive a failing grade for this assignment.
Turning in the Assignment
For this assignment, you must turn in a zip file of a directory
named project5 containing the following files:
- README (containing design decisions and a description of the protocol)
- Makefile
- Source code
Submit the zip file to the appropriate folder on D2L.