2013-12-13 18:51, Gottlob Frege skrev:
No, because this is a producer / consumer scenario.
The producer will only add to the queue.
The consumer is the only thread removing stuff from the queue,
and is also the only thread to call QueueEmpty.
If the Queue tests to be non-empty, then it will also be non-empty
when
the the returned value will be used.
If the Queue tests to be empty, and a value is inserted between the
test,
and the use of the returned value, it is not a problem. since the
recently
added values will be sent the next time through the loop.
The main loop
loop
empty = QueueEmpty();
...
if (not empty and other conditions)
prepare data
send data to webserver
remove stuff form the Queue
end if;
Debug Output
end loop;
Yes, but I would like to understand more about the run time
behaviour,
and the code will allow the Debug Output to be enabled.
I agree in principle, but as I am trying to figure out what goes
wrong, I need debug printouts
and this is what I ended up with.
Before I had one biocking mutex test in the consumer, and one in the
producer,
in the beginning of the loop.
Then the application hung within hours.
Now it took a week for it to hang.
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users