FXIhub / hummingbird

Monitoring and Analysing flash X-ray imaging experiments
http://fxihub.github.io/hummingbird
BSD 2-Clause "Simplified" License
16 stars 14 forks source link

Separate GUI and buffer updates #69

Closed cnettel closed 8 months ago

cnettel commented 8 years ago

Currently, all crucial processing happens on the main GUI thread. This doesn't scale and easily causes missed events only due to updates of larger images.

Ringbuffer would need to be thread-safe, creating a snapshot view of itself (all counters included) to be presented to the current GUI layer. At least, that would be one way to do it. Just doing locking would not cut it, we possibly want to add several new full images to a buffer while a single redraw is happening in the actual GUI.

This would also cause fewer missed events during e.g. resizing or other GUI operations that might be modal (on some platforms).

FilipeMaia commented 8 months ago

97ac1c9 creates threads for the data readers and adds locks around PlotData updates. It does not have the RingBuffer snapshot as I thought it might be too heavy, but I did not observe issues in practice. If we find problems in the future we should give copies of the ringbuffer to replot as suggested above.

FilipeMaia commented 8 months ago

When the incoming data rate is high the line plot sometimes shows artifacts due to ringbuffer update during replot. So it looks like we'll need to return snapshots of the ringbuffer.

FilipeMaia commented 8 months ago

Hopefully, 7aa1237 will finally fix this.