2014-04-22 15:47 GMT+04:00 Sebastian Gesemann <s.gesemann@gmail.com>:
<...>
  - locking a mutex
  - calling cb.erase_first(n);
  - calling cb.resize(cb.capacity());
  - notify writer that there is new free space to write stuff into
  - unlocking the mutex

This is what was happening in the reader thread. What was happening in the writer thread?
 
But the program did not work. The first thing that came to my
attention was that the checked iterators of circular_buffer don't
support this kind of multithreading as they register and unregister
themselves into a linked list without any synchronization.

I had exactly the same thoughts...


--
Best regards,
Antony Polukhin