I am designing an application which communicates with another device via a serial port.
My application buffers the received binary data until the data is valid/of known format, does some processing and then writes back a response. I understand this model is known as the consumer/producer model. The issue I am having with properly implementing this model is that the message processing part of my application is fairly complex and involves calls to other classes/methods, etc., and when spawning a new thread I can only pass it one function. How can I best implement this?
Thank you for any help you can provide.