Brilliant, thankyou very much for clarifying that -- it's really helped.
Doug.
Type: Posts; User: biot023
Brilliant, thankyou very much for clarifying that -- it's really helped.
Doug.
Hi -- thanks very much for replying.
Do you mean that the threads t1 & t2 are still running, so might be stealing the item for the thread in the final test to pop?
And, with regards to the...
Hi -- I was wrong, and the error has arisen even with the new code I put in as I've continued development.
I've pulled it out into a single file with compile instructions at the top, and this...
Hi -- I don't believe it was that, as here are the options I'm passing to compile the program (without the files themselves, and without some image magick stuff):
g++-mp-4.7 -c -std=gnu++11 -pthread...
Oh -- for completeness, here's the code from the one-file example with a main that I couldn't get to replicate the error:
#include <memory>
#include <thread>
#include <queue>
#include...
Hi -- so I was working on a one file version of this code with a main, but guess what? I couldn't replicate the error there!
The only real difference between my example code and the test code that...
That will come in *very* handy, thankyou!
Oh, and the empty for loops were to give things time to happen -- I was getting weird results with calls to usleep().
Perhaps there is a better way of achieving this?
Ah, a main would be trickier, but worth doing, as I can use the exact code from the book I'm using & see if that fails -- I'll post back here when I have one.
Cheers,
Doug.
I have some code which I adapted (barely changing it) from the C++ Concurrency In Action book, so would have expected it to work -- only it doesn't. What I've tried to do is to implement a...
Hi -- I'm just getting to grips with C++ after not developing in it for a long time, and I was most certainly never a guru.
I've been off in the wonderful world of Ruby most recently, and whilst...