I am trying to write a small program to solve the following problems using multithreading in java. I am struggling to even understand where to start, and am looking for some advice. The desired steps in the process are as follows:
- Read in all the text files contained within a given directory
- Create a word count for each one of the files read.
- Write the count of words as an output to a new file in a different directory.
I have written the wordcount function, and that works fine, but would like to know more about how to multithread this operation so that the files are read, the words counted, and then the output is all written in parallel.