Write a multi threaded Linux program that counts up all the numbers found in three separate files
Question:
Write a multi threaded Linux program that counts up all the numbers found in three separate files all at the same time.
The program will require 4 threads:
• The main thread - Creates three child threads and assigns the names of the files to each child thread. Once each child thread is finished, it will print the total of all three files to the screen once the children are done processing them.
• Child thread - Each thread is given the name of a file to process. They will add up all the numbers in their assigned file and report the total back to main. Use the system calls you learned earlier to interact with the files (open, read, close). Use the POSIX library to manage the multithreading. Use the attached files with your program. Use the attached files to test your program, one file per child thread.
numbers2.txt
numbers1.txt
numbers3.txt