I am still working on my realtime application for my car that will be running on Minimal Ubuntu and the gtkmm library. My current application runs alright for a singly thread application. I am in the process of multi-threading it (still learning threads). What I thought would be the best way to rewrite the back end was using a single queue shared across three threads. Someone suggested a better method where I would have a circular buffer in each hardware communication thread. The somehow communicate with the circular queues from the main thread to get the oldest data.
My question is how can I communicate from the main thread to a worker to get data from the buffer in a lock less or in the least amount of locks using either pthreads or glibmm::threads?