#Concurrent programming issue

4 messages · Page 1 of 1 (latest)

muted crescent
#

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

robust galleonBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

fiery falcon
robust galleonBOT
#

This question is being automatically marked as stale.
If your question has been answered, type !solved.
If your question is not answered feel free to bump the post or re-ask.
Take a look at !howto ask for tips on improving your question.