I am new to multithreading and developed a program that receives data from two microcontrollers that measure different temperatures (Ambient and Water) and displays the data on the screen. The program is single-threaded right now and its performance is SUCKS A BIG ONE.
I get basic design approaches with multithreading, but not enough to create a thread to complete the task, but what I don't get is how to get the threads to perform a separate task and put the data in a common data pool. I decided that I needed to create a queue in which there is one consumer and several manufacturers (I would like to use std :: queue). I saw some code in the gtkmm thread documents that show one Con / Pro queue, and they would block the queue object, producing data, and signal that it had finished the sleeping thread, after which the producer would sleep. Why would I need to sleep a stream, there would be data conflicts if I did not sleep any of the streams, and the stream would sleep, causing data attenuation, a significant delay (I need real-time data to be 30 frames sec)
How would I start coding such a queue using the gtkmm / glibmm library.
source share