Hello guys,
I'm having a look at some easy concurrent programming in C++ atm and having trouble putting condition variables into use.
I have written a simple program with a global queue in which 2 threads are pushing numbers: one thread only pushes 1's, another only 2's.
Now I want to notify my main thread whenever a value is available to get read and simply print them out.
However, when running my code I always get the following exception thrown:
"terminate called after throwing and instance of 'std::system_error'
what(): Operation not permitted"
after a single 1 and a 2 got printed out.
Could someone explain to me what I am getting wrong?
Thank you very much :)