Copying with threads, C++
Budget: €8 – €30 EUR
I am looking to learn more C++ so I would like some help for a task I found (please see the attached file "file.cpp", there the changes need to be made, I only want a single file for the solution, I also want comments so I can understand it):
Write a simple echo program that copies the standard input data to the standard output.
The program stops once the end of file is reached.
The particularity of the program is that the behaviour must be implemented using two threads in a
producer-consumer pattern.
- Write the Producer class that reads from standard input and Consumer class that writes to
standard output. Then use the objects of the classes in two different threads.
The program should compile without errors or warnings using gcc under Linux:
g++ -Wall -O2 -pthread -o file file.cpp
Write a simple echo program that copies the standard input data to the standard output.
The program stops once the end of file is reached.
The particularity of the program is that the behaviour must be implemented using two threads in a
producer-consumer pattern.
- Write the Producer class that reads from standard input and Consumer class that writes to
standard output. Then use the objects of the classes in two different threads.
The program should compile without errors or warnings using gcc under Linux:
g++ -Wall -O2 -pthread -o file file.cpp