I have an incoming stream of messages, and want a window that allows the user to scroll through the messages.

This is my current thinking:

* Incoming messages go into single producer single consumer queue
* A thread reads them out and places them into a circular buffer with a sequential id
* This way I could have multiple incoming streams safely placed in the circular buffer and it decouples the input
* Mutex to coordinate circular buffer access between the UI and the thread
* Two notifications from thread to UI one for the first id and one for the last id in the buffer when ever either changes.
* This allows the UI to figure out what it can display, which parts of the circular buffer it needs access, delete overwritten messages. It only accesses the messages required to fill the window at its current size and scroll position.

I'm not happy about the notification into the UI. It would be generated with high frequency. These could be queued or otherwise throttled; latency should not affect the first id but delays in handling the last id could cause problems in corner cases such as viewing the very end of a full buffer *unless* the UI makes a copy of the messages it displays, which I would like to avoid.

Does this sound like the right approach? Any tweaks that could make it a bit more palatable?