subject

For this work, your program is to read War and Peace (a text copy is included with this assignment) and it is to count and tally each of the words that are 6 or more characters long. And again, you will only use Linux (not library) file functions, i. e. open, close, read, seek. BUT, it is to do this using threads. Each thread will take a chunk of the file and process it, returning it’s results to the main which tallies (or if you directly tally to shared memory, that is okay) and then the main will print the ten, 6 or more character, words with the highest tallies, in order highest to lowest, and their associated counts. i. e. The top ten words and the number of times that word appears in the text.
Your program should take two parameters on the command line: FileName and ThreadCount
FileName is the name of the file to read – WarAndPeace. txt
ThreadCount is the number of threads you should spawn to evenly divide the work.
That is to say – if the parameter is 1, the entire file would be read and processed by one thread. If the parameter is 5, then you would divide the file into 5 equal parts (accounting for rounding on the last part). So thread one would take the first 1/5 of the file, thread 2 the second fifth and so on. But, these threads should all be launched together in a loop. So that they can execute in parallel.
#include in your code and in main, include the code below in your main. This will display how much time your program takes. Your submission should include a run with 1 thread, 2 threads, 4 threads, and 8 threads. How do the times compare?

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
Competent nonverbal communication involves interacting with others in a manner that is appropriate for which of the following? select all that apply. situation task individuals
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
Write a full class definition for a class named player , and containing the following members: a data member name of type string .a data member score of type int .a member function called setname that accepts a parameter and assigns it to name . the function returns no value.a member function called setscore that accepts a parameter and assigns it to score . the function returns no value.a member function called getname that accepts no parameters and returns the value of name .a member function called getscore that accepts no parameters and returns the value of score .this is what i have, aparently this is wrong: class player{private: string name; int score; public: void player: : setname (string n){name =n; }void player: : setscore (int s){score = s; }string player: : getname (){return name; }int player: : getscore (){return score; }};
Answers: 2
question
Computers and Technology, 23.06.2019 08:00
Match the items with their respective descriptions.
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
Match the file formats with the types of multimedia they can store
Answers: 2
You know the right answer?
For this work, your program is to read War and Peace (a text copy is included with this assignment)...
Questions
question
Mathematics, 05.10.2020 01:01
question
Mathematics, 05.10.2020 01:01
Questions on the website: 13722367