
22 Apr
2014
22 Apr
'14
6:02 p.m.
2014-04-22 15:47 GMT+04:00 Sebastian Gesemann
- 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