There and many producer and consumer threads that share separate circular buffers that need to communicate data back to the main GUI thread for display.
The main GUI is made up of QtDesigner files that process their data using QtScript files. ( I mention this since my C++ must fairly generic since the .ui can change at any time and the computations to match the .ui are scriptable.)
I was having the scripts process the circular buffer from within the threads but referencing the .ui object in the main thread from another thread and inside a script seems to be a big no no. Since there are many threads no matter where I create the object it will always be out of context.
My questions is since running a circular buffer with threads and the main gui thread defeats the purpose, I am going to need a way to check the buffer and run scripts on it from within the main gui thread.
My best guess was to QMutex a counter for the buffer and then have a QTimer from the main gui fire off every second or so and process any data. This is no where as efficient as a producer/consumer in separate threads but I am unsure how to keep the main gui responsive and achieve the same results.
Any suggestion are appreciated.
Bookmarks