Hello guys, I had this small C++ project to do which I did. There is a big description but I will write only main part.
Two monitors are created — one for data and one for results. Each monitor contains an array, for
unprocessed data and computed results respectively. Main thread reads data from a data
file and writes them to the data monitor, while a selected amount of worker threads
concurrently take (remove) items one by one from the data monitor, compute their
result and write it to the result monitor.
I wrote the code but it appears I included taking (removing) items and computing in the Main thread instead of the worker thread. When I try to move it to the worker thread something does not work. Can anyone help me on this matter?
there is the code if anyone can help:
https://codeshare.io/gigacpp